aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_switchdelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_switchdelegate.qml')
-rw-r--r--tests/auto/controls/data/tst_switchdelegate.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_switchdelegate.qml b/tests/auto/controls/data/tst_switchdelegate.qml
index 4a5d711f..bb4b9d6a 100644
--- a/tests/auto/controls/data/tst_switchdelegate.qml
+++ b/tests/auto/controls/data/tst_switchdelegate.qml
@@ -183,6 +183,23 @@ TestCase {
compare(control.pressed, false)
verify(spy.success)
+ // release in the middle
+ spy.expectedSequence = [["pressedChanged", { "pressed": true, "checked": false }],
+ "pressed"]
+ mousePress(control.indicator, 0, 0, Qt.LeftButton)
+ compare(control.pressed, true)
+ verify(spy.success)
+ mouseMove(control.indicator, control.indicator.width / 2 - 1, 0)
+ compare(control.pressed, true)
+ spy.expectedSequence = [["pressedChanged", { "pressed": false, "checked": false }],
+ "released",
+ "clicked"]
+ mouseRelease(control.indicator, control.indicator.width / 2 - 1, 0, 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)