aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-04 17:48:29 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-05 12:07:24 +0000
commitae3e7f0799fcdd094e54d792e1a9b13c0e7730aa (patch)
tree17883a4bb4b164283d5678cb9024612548f6870d /tests/auto
parent19c3993abd691843194cce6c047773acc21c2523 (diff)
Add QQuickTumbler::moving
[ChangeLog][Controls][Tumbler] Added a moving-property that describes whether the tumbler is currently moving, due to the user either dragging or flicking the tumbler. Change-Id: Ic86d243cdbdfa8fcd7a7932264332c04a16e020a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_tumbler.qml28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml
index b3230ca4..bca2e976 100644
--- a/tests/auto/controls/data/tst_tumbler.qml
+++ b/tests/auto/controls/data/tst_tumbler.qml
@@ -40,7 +40,7 @@
import QtQuick 2.2
import QtTest 1.0
-import QtQuick.Controls 2.1
+import QtQuick.Controls 2.2
TestCase {
id: testCase
@@ -1045,4 +1045,30 @@ TestCase {
++tumbler.currentIndex;
tryCompare(tumblerView, "offset", 4, tumblerView.highlightMoveDuration * 2);
}
+
+ function test_moving_data() {
+ return [
+ { tag: "wrap:true", wrap: true },
+ { tag: "wrap:false", wrap: false }
+ ]
+ }
+
+ function test_moving(data) {
+ createTumbler({wrap: data.wrap, model: 5})
+ compare(tumbler.wrap, data.wrap)
+ compare(tumbler.moving, false)
+
+ waitForRendering(tumbler)
+
+ mousePress(tumbler, tumbler.width / 2, tumbler.height / 2, Qt.LeftButton)
+ compare(tumbler.moving, false)
+
+ for (var y = tumbler.height / 2; y >= tumbler.height / 4; y -= 10)
+ mouseMove(tumbler, tumbler.width / 2, y, 1)
+ compare(tumbler.moving, true)
+
+ mouseRelease(tumbler, tumbler.width / 2, tumbler.height / 4, Qt.LeftButton)
+ compare(tumbler.moving, true)
+ tryCompare(tumbler, "moving", false)
+ }
}