Hello,
I've got a state machine, but I need a bit complexer behavior than the default: when I enter a particular state, some times I need to have a regular transition to another state. Other times I need to return to previous state.
For example, having states A B C, say that transition T moves state from A to C and from B to C. I need that a transition S moves from C to A when T occurred in state A and from C to B when it occurred in state B.
As you can see, this is a bit outside of the definition of finite state machine, as this is stack based and therefore needs "memory".
I'm aware of the QHistoryState, but the documentation says it's made when moving outside the "level" of the current state (edit: precisely it says "A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited"), while in my case, A, B and C are on the same level and as matter of facts it doesn't work
Is there something in State Machine Framework that allows me to do this? Maybe subclassing QStateMachine or implementing a custom QAbstractState that may be similar to QHistoryState?
I've some ideas on how to do this, but I'm hoping, of course, for an existing Qt solution.
Thanks in advance
~Aki
Bookmarks