Hi,

I'm building an extension for QStateMachine, but I'm running into
problems with what seems to be a restriction on transitions. I would
like to be able to traverse from state A to state B even if state A
has not been defined as the source for that transition. An example how
I would like to do it:

stateMachine->setInitialState(stateA);
stateMachine->addTransition(myObject, SIGNAL(signalA()), stateA);
stateMachine->addTransition(myObject, SIGNAL(signalB()), stateB);
stateMachine->addTransition(myObject, SIGNAL(signalC()), stateC);

So an external object could trigger the state machine to enter
different child states regardless of the source child state.

Right now, the API forces you to do something like this:

stateMachine->setInitialState(stateA);
stateA->addTransition(myObject, SIGNAL(signalB()), stateB);
stateA->addTransition(myObject, SIGNAL(signalC()), stateC);
stateB->addTransition(myObject, SIGNAL(signalA()), stateA);
stateB->addTransition(myObject, SIGNAL(signalC()), stateC);
stateC->addTransition(myObject, SIGNAL(signalA()), stateA);
stateC->addTransition(myObject, SIGNAL(signalB()), stateB);

So in all of these cases, state machine is actually the source state,
but the state machine framework requires creating the transition by
specifying the bottom level child source state. Would this still fit
into the idea of the framework? Or should I be building my own?

- Olli Salonen
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to