QStateMachine animation with QFinalState, bug?
-
I mean that with that line for example:
m_pSS->addTransition(m_pFS);as soon as your state machine enters them_pSSstate it will go to them_pFSstate hence your animation not working as you expect. Thus my question, shouldn't you have a condition to transition fromm_pSStom_pFS? For example a mouse click, number of animation repetition etc. -
Oh, understand! :-)
No condition is not required.
And sorry for my mistake in first post, when i said "animation is not working" I mean that after call m_slide_mashine->start() we immediately go from m_pSS -> m_pFS -> QFinalState (i.e. without duration) , but when I do not use QFinalState animation work as expected (with duration as I set in pAni->setDuration() ). -
It happens precisely because you didn't put any condition for the transition between the two states. If you take a look at the Simple State Machine example, the condition to change state is a mouse click.
So you have to determine what should trigger the transition between
m_pSSandm_pFSand use the adequate QAbstractTransition subclass. -
The animation is not broken.
Like I already wrote:
m_pSS->addTransition(m_pFS);means that as soon as your state machine enters them_pSSstate it will transition tom_pFSthus the state machine will stop since it's a final state. -
You're welcome !
So you could make it work the way you wanted ?
-
Great !
You'r welcome !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)