aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_switch.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-01-14 21:58:48 +0100
committerLiang Qi <liang.qi@qt.io>2017-01-14 21:58:48 +0100
commit537eced61381f0ce1eabdc797bb0dacd11e11d39 (patch)
tree13ccb774329ca0214e89675e5f1d1ffa638f8ef6 /tests/auto/controls/data/tst_switch.qml
parent698cffce2171bed322aa9d0df1fda316c379efda (diff)
parent6f7852a307c7ebbdb3b6efa00cbf7626b072bbc1 (diff)
Merge remote-tracking branch 'origin/5.8.0' into 5.8
Diffstat (limited to 'tests/auto/controls/data/tst_switch.qml')
-rw-r--r--tests/auto/controls/data/tst_switch.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml
index 314848c8..4a229ff0 100644
--- a/tests/auto/controls/data/tst_switch.qml
+++ b/tests/auto/controls/data/tst_switch.qml
@@ -187,6 +187,23 @@ TestCase {
compare(control.pressed, false)
verify(spy.success)
+ // release in the middle
+ spy.expectedSequence = [["pressedChanged", { "pressed": true, "checked": false }],
+ "pressed"]
+ mousePress(control, 0, 0, Qt.LeftButton)
+ compare(control.pressed, true)
+ verify(spy.success)
+ mouseMove(control, control.width / 4, control.height / 4, 0, Qt.LeftButton)
+ compare(control.pressed, true)
+ spy.expectedSequence = [["pressedChanged", { "pressed": false, "checked": false }],
+ "released",
+ "clicked"]
+ mouseRelease(control, control.width / 4, control.height / 4, Qt.LeftButton)
+ compare(control.checked, false)
+ compare(control.pressed, false)
+ tryCompare(control, "position", 0) // QTBUG-57944
+ verify(spy.success)
+
// right button
spy.expectedSequence = []
mousePress(control, control.width / 2, control.height / 2, Qt.RightButton)