aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflipable/data/flip-flipable.qml
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-03-29 12:54:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-30 05:53:48 +0200
commitb8f6e3736cf5b73b695d4820a35663fa18708981 (patch)
treed5bce39364b4e24cb04a0af2831b36257e10f440 /tests/auto/quick/qquickflipable/data/flip-flipable.qml
parent200f783745b571725f899f08c34d1155be632523 (diff)
Improve Flipable element unit tests
Ensure that the reported side is updated correctly due to a rotation transform triggered by a state change. Change-Id: I039c6bcba872c7731c810137551e760414fabc05 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickflipable/data/flip-flipable.qml')
-rw-r--r--tests/auto/quick/qquickflipable/data/flip-flipable.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflipable/data/flip-flipable.qml b/tests/auto/quick/qquickflipable/data/flip-flipable.qml
new file mode 100644
index 0000000000..4f22a0df6d
--- /dev/null
+++ b/tests/auto/quick/qquickflipable/data/flip-flipable.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.0
+
+Flipable {
+ id: flipable
+ width: 640; height: 480
+ property bool flipped: false
+
+ front: Rectangle { color: "red"; anchors.fill: flipable }
+ back: Rectangle { color: "blue"; anchors.fill: flipable }
+
+ transform: Rotation {
+ id: rotation
+ origin.x: flipable.width/2
+ origin.y: flipable.height/2
+ axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis
+ angle: 0 // the default angle
+ }
+
+ states: State {
+ name: "back"
+ PropertyChanges { target: rotation; angle: 540 }
+ when: flipable.flipped
+ }
+
+ transitions: Transition {
+ NumberAnimation { target: rotation; property: "angle"; duration: 500 }
+ }
+}