Wysota, thanks for answer, but unfortunately, I didn't understand you or your state machine is a "one way ticket" machine
QState *masterState = new QState;
QState *s1 = new QState(masterState);
QState *s2 = new QState(masterState);
QState *s3 = new QState(masterState);
QState *s4 = new QState(masterState);
masterState->setInitialState(s1);
machine.addState(masterState);
masterState->addTransition(signalEmitter, SIGNAL(received_1()), s1);
masterState->addTransition(signalEmitter, SIGNAL(received_2()), s2);
masterState->addTransition(signalEmitter, SIGNAL(received_3()), s3);
masterState->addTransition(signalEmitter, SIGNAL(received_4()), s4);
QState *masterState = new QState;
QState *s1 = new QState(masterState);
QState *s2 = new QState(masterState);
QState *s3 = new QState(masterState);
QState *s4 = new QState(masterState);
masterState->setInitialState(s1);
machine.addState(masterState);
masterState->addTransition(signalEmitter, SIGNAL(received_1()), s1);
masterState->addTransition(signalEmitter, SIGNAL(received_2()), s2);
masterState->addTransition(signalEmitter, SIGNAL(received_3()), s3);
masterState->addTransition(signalEmitter, SIGNAL(received_4()), s4);
To copy to clipboard, switch view to plain text mode
You got only one way transitions, when you go to state s1, you don't have any transition that will let you to go back from it... Or I'd simply not understand you. Please came back with a more extensive example
anda_skoa for this example I didn't need this kind of functionality, but I'll probably need this in the future, thanks for answer
Bookmarks