QStateMachine, like most things in Qt, is event triggered.
That can be low level events, signals like button clicks and also custom signals.
There are a couple of options to execute things when a state is entered:
- connect a slot to the state's entered() signal
- use the QState's property assignment mechanism to set values on QObjects and have the property setters call further methods if necessary
- connect to the transition's signals
You could try to analyze your current state machine in order to craete a state diagram, i.e. identify the states, the transitions and what triggers each transition.
Then model that with QStateMachine's classes.
Cheers,
_





Reply With Quote
Bookmarks