[Qt-interest] Setting State in QStateMachine

Sean Harmer sean.harmer at maps-technology.com
Tue Jun 21 21:32:00 CEST 2011


Hi,

On 21/06/2011 19:44, NoRulez wrote:
> I've a simple statemachine with 4 states. After clicking a button the states will change.
>
> Now the problem I have is if I get a signal I want to change the state to e.g. 2
>
> I use addTransition for the entered() signal, but the state isn't entered.
>
> Could anybody give me a hint on how to switch states?

Can you post some code that shows the problem please?

How do you add the transition such that it responds to the clicked() 
signal of your button? Is your state machine running? Have you correctly 
set an initial state? Is the state machine in the correct state (the 
source state of the transition) when the signal is emitted?

Cheers,

Sean



More information about the Qt-interest-old mailing list