aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanimations/data/pathTransition.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickanimations/data/pathTransition.qml')
-rw-r--r--tests/auto/quick/qquickanimations/data/pathTransition.qml41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimations/data/pathTransition.qml b/tests/auto/quick/qquickanimations/data/pathTransition.qml
new file mode 100644
index 0000000000..55ffc33f95
--- /dev/null
+++ b/tests/auto/quick/qquickanimations/data/pathTransition.qml
@@ -0,0 +1,41 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 800
+ height: 800
+
+ Rectangle {
+ id: redRect; objectName: "redRect"
+ color: "red"
+ width: 50; height: 50
+ x: 500; y: 50
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: redRect
+ x: 100; y: 700
+ }
+ }
+
+ transitions: Transition {
+ to: "moved"; reversible: true
+ PathAnimation {
+ id: pathAnim
+ target: redRect
+ duration: 300
+ path: Path {
+ PathCurve { x: 100; y: 100 }
+ PathCurve { x: 200; y: 350 }
+ PathCurve { x: 600; y: 500 }
+ PathCurve {}
+ }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: parent.state = parent.state == "moved" ? "" : "moved"
+ }
+}