aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/data/rebound.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickflickable/data/rebound.qml')
-rw-r--r--tests/auto/quick/qquickflickable/data/rebound.qml41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/data/rebound.qml b/tests/auto/quick/qquickflickable/data/rebound.qml
new file mode 100644
index 0000000000..d46f9dd189
--- /dev/null
+++ b/tests/auto/quick/qquickflickable/data/rebound.qml
@@ -0,0 +1,41 @@
+import QtQuick 2.0
+
+Flickable {
+ id: flick
+
+ property int transitionDuration: 100
+ property bool transitionEnabled: true
+ property int transitionsStarted
+
+ width: 200
+ height: 200
+
+ contentWidth: width * 1.25
+ contentHeight: width * 1.25
+
+ rebound: Transition {
+ objectName: "rebound"
+ enabled: flick.transitionEnabled
+ SequentialAnimation {
+ PropertyAction { target: flick; property: "transitionsStarted"; value: flick.transitionsStarted + 1 }
+ NumberAnimation {
+ properties: "x,y"
+ easing.type: Easing.OutElastic
+ duration: flick.transitionDuration
+ }
+ }
+ }
+
+ Grid {
+ columns: 2
+ Repeater {
+ model: 4
+ Rectangle {
+ width: flick.contentWidth/2
+ height: flick.contentHeight/2
+ color: Qt.rgba(Math.random(), Math.random(), Math.random(), 1)
+ }
+ }
+ }
+}
+