aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanimations/data/restartNestedAnimationGroupWhenDirty.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickanimations/data/restartNestedAnimationGroupWhenDirty.qml')
-rw-r--r--tests/auto/quick/qquickanimations/data/restartNestedAnimationGroupWhenDirty.qml96
1 files changed, 96 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimations/data/restartNestedAnimationGroupWhenDirty.qml b/tests/auto/quick/qquickanimations/data/restartNestedAnimationGroupWhenDirty.qml
new file mode 100644
index 0000000000..da0de96448
--- /dev/null
+++ b/tests/auto/quick/qquickanimations/data/restartNestedAnimationGroupWhenDirty.qml
@@ -0,0 +1,96 @@
+import QtQuick
+
+Rectangle {
+ width: 300
+ height: 300
+
+ // test ParallelAnimation in SequentialAnimation
+ Rectangle {
+ id: line0
+ y: 100
+ width: parent.width
+ height: 2
+ color: "blue"
+ }
+ Rectangle {
+ id: target0
+ objectName: "target0"
+ y: 100
+ anchors.verticalCenter: line0.verticalCenter
+ height: line0.height * 5
+ width: height
+ color: "red"
+ radius: height/2
+
+ property bool onFinishedCalled : false;
+
+ SequentialAnimation {
+ id: seqAnim0
+ objectName: "seqAnim0"
+ loops: 2
+ running: true
+ ParallelAnimation {
+ NumberAnimation {
+ id: anim0
+ target: target0
+ property: "x"
+ from: 0
+ to: 50
+ duration: 500
+ }
+ }
+ Component.onCompleted: anim0.to = 290
+ onFinished: target0.onFinishedCalled = true
+ }
+ }
+
+ // test SequentialAnimation in ParallelAnimation
+ Rectangle {
+ id: line1
+ y: 200
+ width: parent.width
+ height: 2
+ color: "blue"
+ }
+ Rectangle {
+ id: target1
+ objectName: "target1"
+ anchors.verticalCenter: line1.verticalCenter
+ height: line1.height * 5
+ width: height
+ color: "yellow"
+ radius: height/2
+
+ property bool onFinishedCalled : false;
+
+ ParallelAnimation {
+ id: parAnim0
+ objectName: "parAnim0"
+ loops: 2
+ running: true
+ SequentialAnimation {
+ NumberAnimation {
+ id: anim1
+ target: target1
+ property: "x"
+ from: 0
+ to: 50
+ duration: 500
+ }
+ }
+ Component.onCompleted: anim1.to = 290
+ onFinished: target1.onFinishedCalled = true
+ }
+ }
+
+ Timer {
+ interval: 400
+ running: true
+ onTriggered: {
+ seqAnim0.pause()
+ parAnim0.pause()
+ anim0.to = 140
+ anim1.to = 140
+ }
+ }
+}