Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
5.14.2
-
None
-
Windows 10 64 Bits
Qt 5.14.2 MSVC 2017
Description
Hi,
I am using a QScxmlStateMachine with direct access to the underlying data model to get the scxml property, and it seems that some qlist are converted in QVariantList.
Here is a minimal example with a QScxmlEcmaScriptDataModel created directly with the exact same behavior than when I am getting the data model from the state machine created from the scxml file. I had to give it a state machine to avoid a crash at the setup() step.
QScxmlEcmaScriptDataModel datamodel; datamodel.setStateMachine(machine); QVariantMap setup; setup.insert("data", QVariant::fromValue(QList<QPair<int, int>>())); datamodel.setup(setup); QList<QPair<int, int>> data = {{2, 3}, {5, 4}}; datamodel.setScxmlProperty("data", QVariant::fromValue(data), "error"); qDebug() << datamodel.scxmlProperty("data");
The QVariant printed is
QVariant(QVariantList, (QVariant(QPair<int,int>, ), QVariant(QPai r<int,int>, )))
The QList is changed to a QVariantList. This is not the case if I configure a
QList<int> instead of a QList<QPair<int, int>>. If we grab the property directly on the slot connected to a connectToEvent, we do not have this conversion.
It seems that this conversion in QVariantList was introduced when I did the update from Qt 5.12 to Qt 5.14.2.
Is it a bug ? Can I call the scxmlProperty of the data model to get access to the property or I should rely only on the interface of the state machine ?
Best regards,
Simon