aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-11-22 14:21:08 +0100
committerMitch Curtis <mitch.curtis@qt.io>2016-11-22 13:43:58 +0000
commit08ba34d6a8cf7e7ab21ce51ca6aa7d812d035a67 (patch)
treedbd1b9aa096c47903629d092d7cf9a364f496aec /tests
parent2c6553fa5ea19e7861b31587ac879da83ebb0925 (diff)
SwipeDelegate: fix broken swiping after calling SwipeDelegate.close()
Reset the internal state when close() is called to ensure that it's consistent. Task-number: QTBUG-57243 Change-Id: Id52724e0eb296c3f8a4fc0a0587a04558b1d1ab6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_swipedelegate.qml16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml
index fa2d218f..067fed1e 100644
--- a/tests/auto/controls/data/tst_swipedelegate.qml
+++ b/tests/auto/controls/data/tst_swipedelegate.qml
@@ -1054,17 +1054,17 @@ TestCase {
text: "SwipeDelegate"
width: 150
- onClicked: close()
-
swipe.right: Item {
width: parent.width
height: parent.height
+
+ SwipeDelegate.onClicked: swipe.close()
}
}
}
function test_close() {
- var control = swipeDelegateComponent.createObject(testCase);
+ var control = closeSwipeDelegateComponent.createObject(testCase);
verify(control);
swipe(control, 0.0, -1.0);
@@ -1073,6 +1073,16 @@ TestCase {
compare(control.swipe.rightItem.x, 0);
tryCompare(control.swipe.rightItem, "x", control.background.x + control.background.width);
+ mousePress(control);
+ verify(control.swipe.rightItem.SwipeDelegate.pressed);
+
+ mouseRelease(control);
+ verify(!control.swipe.rightItem.SwipeDelegate.pressed);
+ tryCompare(control.swipe, "position", 0);
+
+ // Swiping after closing should work as normal.
+ swipe(control, 0.0, -1.0);
+
control.destroy();
}