I have a class whose internal state determines the layout in a QML file. Now this internal state is mostly determined by a state machine. However part of it is not determined by the state machine, but instead relies on other member variables to be set. I have the following situation:
void foo()
{
emit stateChange1();
...
mMember = true;
}
Here stateChange1()
might change the state of the state machine, resulting in qml changes). mMember directly changes the qml.
Now my problem is that it is crucial to process the (possible) state changes implied by statechange1()
before the state changes implied by setting mMember
. However since the QStateMachine works asynchronously, I cannot guarantee this. Are there any elegant solutions for this problem?