diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-02-20 14:23:36 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-02-20 14:28:55 +0000 |
commit | b6e593a69c553d7115c99a7e24db8ed2469609de (patch) | |
tree | 77943632d2f97ea1d0a653f5d085a519bb701510 /tests/auto/controls/data/tst_swipedelegate.qml | |
parent | f008d17de8bc37f614e45b4ba557f3d2b428b178 (diff) |
Fix tst_swipedelegate::test_eventsToLeftAndRight()
The test fails with the Fusion style and a static build on Linux.
Even if either "dx" or "dy" is defined as 0, TestCase::mouseDrag()
drags _at least_ the distance of QStyleHints::startDragDistance() in
_both_ directions. Therefore, if we start the drag from the vertical
center of the control, a horizontal drag may end below the control
and then SwipeDelegate considers the swipe canceled.
Change-Id: Ib735ebeb2184d095dfaf0a4c3bdff0bead4bdbd6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_swipedelegate.qml')
-rw-r--r-- | tests/auto/controls/data/tst_swipedelegate.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml index d603bd7f..1668dc84 100644 --- a/tests/auto/controls/data/tst_swipedelegate.qml +++ b/tests/auto/controls/data/tst_swipedelegate.qml @@ -572,7 +572,7 @@ TestCase { verify(closedSpy.valid); // The button should be pressed instead of the SwipeDelegate. - mouseDrag(control, control.width / 2, control.height / 2, -control.width, 0); + mouseDrag(control, control.width / 2, 0, -control.width, 0); // Mouse has been released by this stage. verify(!control.pressed); compare(control.swipe.position, -1.0); @@ -607,7 +607,7 @@ TestCase { // Returning back to a position of 0 and pressing on the control should // result in the control being pressed. - mouseDrag(control, control.width / 2, control.height / 2, control.width * 0.6, 0); + mouseDrag(control, control.width / 2, 0, control.width * 0.6, 0); tryCompare(closedSpy, "count", 1); compare(control.swipe.position, 0); mousePress(control, control.width / 2, control.height / 2); |