aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/data
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2012-06-06 11:17:19 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-08 01:13:05 +0200
commit836e075ea016f960b0e983fc96f61466e064757b (patch)
treebfcc867c1a3478343a18a416255ed172c7fa9661 /tests/auto/quick/qquickflickable/data
parent9738c4b4765bb641f2f080e02ae6867b3e18d8a3 (diff)
rebound property for Flickable
This property specifies the transition to be used when the flickable snaps back to its bounds. Change-Id: I2bb9680dad219a4c7c911f0e4dda37ae739349c6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickflickable/data')
-rw-r--r--tests/auto/quick/qquickflickable/data/rebound.qml41
-rw-r--r--tests/auto/quick/qquickflickable/data/resize.qml10
2 files changed, 51 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)
+ }
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquickflickable/data/resize.qml b/tests/auto/quick/qquickflickable/data/resize.qml
index 1a9ef54107..2f7ae7b8bb 100644
--- a/tests/auto/quick/qquickflickable/data/resize.qml
+++ b/tests/auto/quick/qquickflickable/data/resize.qml
@@ -18,6 +18,16 @@ Rectangle {
contentWidth: 300
contentHeight: 300
+ rebound: setRebound ? boundsTransition : null
+ Transition {
+ id: boundsTransition
+ objectName: "rebound"
+ NumberAnimation {
+ properties: "x,y"
+ easing.type: Easing.OutElastic
+ }
+ }
+
Rectangle {
width: flick.contentWidth
height: flick.contentHeight