aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_rangeslider.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_rangeslider.qml')
-rw-r--r--tests/auto/controls/data/tst_rangeslider.qml62
1 files changed, 47 insertions, 15 deletions
diff --git a/tests/auto/controls/data/tst_rangeslider.qml b/tests/auto/controls/data/tst_rangeslider.qml
index 09ccb3be..97104856 100644
--- a/tests/auto/controls/data/tst_rangeslider.qml
+++ b/tests/auto/controls/data/tst_rangeslider.qml
@@ -309,18 +309,18 @@ TestCase {
secondPressedSpy.target = control.second
verify(secondPressedSpy.valid)
- mousePress(control, control.width * 0.5, control.height * 0.5, Qt.LeftButton)
- compare(firstPressedSpy.count, 0)
+ mousePress(control, control.width * 0.25, control.height * 0.75, Qt.LeftButton)
+ compare(firstPressedSpy.count, 1)
compare(secondPressedSpy.count, 0)
- compare(control.first.pressed, false)
+ compare(control.first.pressed, true)
compare(control.first.value, 0.0)
compare(control.first.position, 0.0)
compare(control.second.pressed, false)
compare(control.second.value, 1.0)
compare(control.second.position, 1.0)
- mouseRelease(control, control.width * 0.5, control.height * 0.5, Qt.LeftButton)
- compare(firstPressedSpy.count, 0)
+ mouseRelease(control, control.width * 0.25, control.height * 0.75, Qt.LeftButton)
+ compare(firstPressedSpy.count, 2)
compare(secondPressedSpy.count, 0)
compare(control.first.pressed, false)
compare(control.first.value, 0.0)
@@ -329,9 +329,19 @@ TestCase {
compare(control.second.value, 1.0)
compare(control.second.position, 1.0)
- mousePress(control, 0, 0, Qt.LeftButton)
- compare(firstPressedSpy.count, 0)
- compare(secondPressedSpy.count, 0)
+ mousePress(control, control.width * 0.75, control.height * 0.25, Qt.LeftButton)
+ compare(firstPressedSpy.count, 2)
+ compare(secondPressedSpy.count, 1)
+ compare(control.first.pressed, false)
+ compare(control.first.value, 0.0)
+ compare(control.first.position, 0.0)
+ compare(control.second.pressed, true)
+ compare(control.second.value, 1.0)
+ compare(control.second.position, 1.0)
+
+ mouseRelease(control, control.width * 0.75, control.height * 0.25, Qt.LeftButton)
+ compare(firstPressedSpy.count, 2)
+ compare(secondPressedSpy.count, 2)
compare(control.first.pressed, false)
compare(control.first.value, 0.0)
compare(control.first.position, 0.0)
@@ -339,9 +349,19 @@ TestCase {
compare(control.second.value, 1.0)
compare(control.second.position, 1.0)
- mouseRelease(control, 0, 0, Qt.LeftButton)
- compare(firstPressedSpy.count, 0)
- compare(secondPressedSpy.count, 0)
+ mousePress(control, 0, control.height, Qt.LeftButton)
+ compare(firstPressedSpy.count, 3)
+ compare(secondPressedSpy.count, 2)
+ compare(control.first.pressed, true)
+ compare(control.first.value, 0.0)
+ compare(control.first.position, 0.0)
+ compare(control.second.pressed, false)
+ compare(control.second.value, 1.0)
+ compare(control.second.position, 1.0)
+
+ mouseRelease(control, 0, control.height, Qt.LeftButton)
+ compare(firstPressedSpy.count, 4)
+ compare(secondPressedSpy.count, 2)
compare(control.first.pressed, false)
compare(control.first.value, 0.0)
compare(control.first.position, 0.0)
@@ -350,8 +370,8 @@ TestCase {
compare(control.second.position, 1.0)
mousePress(control, control.first.handle.x, control.first.handle.y, Qt.LeftButton)
- compare(firstPressedSpy.count, 1)
- compare(secondPressedSpy.count, 0)
+ compare(firstPressedSpy.count, 5)
+ compare(secondPressedSpy.count, 2)
compare(control.first.pressed, true)
compare(control.first.value, 0.0)
compare(control.first.position, 0.0)
@@ -363,8 +383,8 @@ TestCase {
var toX = horizontal ? control.width * 0.5 : control.first.handle.x
var toY = horizontal ? control.first.handle.y : control.height * 0.5
mouseMove(control, toX, toY, Qt.LeftButton)
- compare(firstPressedSpy.count, 1)
- compare(secondPressedSpy.count, 0)
+ compare(firstPressedSpy.count, 5)
+ compare(secondPressedSpy.count, 2)
compare(control.first.pressed, true)
compare(control.first.value, 0.0)
compare(control.first.position, 0.5)
@@ -374,6 +394,18 @@ TestCase {
compare(control.second.position, 1.0)
compare(control.second.visualPosition, horizontal ? 1.0 : 0.0)
+ mouseRelease(control, toX, toY, Qt.LeftButton)
+ compare(firstPressedSpy.count, 6)
+ compare(secondPressedSpy.count, 2)
+ compare(control.first.pressed, false)
+ compare(control.first.value, 0.5)
+ compare(control.first.position, 0.5)
+ compare(control.first.visualPosition, 0.5)
+ compare(control.second.pressed, false)
+ compare(control.second.value, 1.0)
+ compare(control.second.position, 1.0)
+ compare(control.second.visualPosition, horizontal ? 1.0 : 0.0)
+
control.destroy()
}