Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0
-
None
-
all
-
9bc7e70c00736678d1430190566d2575c2ec764a
Description
If you call pause() immediately after an animation is started, this animation will change its running state to false before it really finishes.
A patch that solves this problem is attached.
Code to reproduce the bug:
Item { width: 200 height: 200 MouseArea { anchors.fill: parent; onClicked: animation.running = true; } Timer { id: holdTimer interval: 1000 onTriggered: animation.paused = false; } SequentialAnimation { id: animation onCompleted: console.log("animation completed"); ScriptAction { script: console.log("action 1"); } ScriptAction { script: { animation.paused = true; holdTimer.running = true; } } PauseAnimation { duration: 200; } ScriptAction { script: console.log("action 2"); } } }
How to reproduce:
1 Click and wait.
1.1 The following output is the correct one:
action 1
action 2
animation completed
1.2 But the following output is generated:
action 1
animation completed
action 2