Solved OnStopped event is not fired in SequentialAnimation
-
Please, look at this code:
SequentialAnimation { id: animStep PropertyAction { target: rotSpin; property: "origin.x"; value: xCenterNeedle } PropertyAction { target: rotSpin; property: "origin.y"; value: yCenterNeedle } NumberAnimation { id: numStep; target: rotSpin; property: "angle"; easing.type: Easing.Linear; to: _degree; duration: _time; onStopped: { console.log("NumberAnimation has ended"); } } PauseAnimation { duration: 1000 } onStopped: { console.log("SequentialAnimation has ended"); }
When I run this animation I get the "SequentialAnimation has ended" message only. Instead I need to know when an Animation inside the sequence has ended.
How to achieve this?
-
Maybe try with slot
onRunningChanged
? http://doc.qt.io/qt-5/qml-qtquick-animation.html#running-prop -
I found a workaround adding a ScriptAction after the Animation I'm interested to.
-
@Mark81 said in OnStopped event is not fired in SequentialAnimation:
Instead I need to know when an Animation inside the sequence has ended.
The documentation of stopped() signal says that it won't work:
It is only triggered for top-level, standalone animations. It will not be triggered for animations in a Behavior or Transition, or animations that are part of an animation group.
-
Thanks, I forgot that sentence.
It's a pity. Calling the slots also for internal Animations would lead to a very high potential to sync events. -
Yep, you're right.