aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/testlib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-11-21 11:34:57 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-11-22 09:50:11 +0100
commitaa3813366a8e772cd58c9253461cf2dc50b97a9d (patch)
treee306a60fa9b2d1f7dd2e6b245fdf05214c7c55df /src/imports/testlib
parent4241bb4d26ef69eb212e0274bad0926ec71bead9 (diff)
parentacb6ed0815f92588c3ff875a568e9561fe61218c (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/qml/qml/qqmlextensionplugin.cpp tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
Diffstat (limited to 'src/imports/testlib')
-rw-r--r--src/imports/testlib/TestCase.qml8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 6e075d8792..fff375b49a 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -1425,8 +1425,12 @@ Item {
ddy = 0
mousePress(item, x, y, button, modifiers, delay)
- //trigger dragging
- mouseMove(item, x + util.dragThreshold + 1, y + util.dragThreshold + 1, moveDelay, button)
+
+ // Trigger dragging by dragging past the drag threshold, but making sure to only drag
+ // along a certain axis if a distance greater than zero was given for that axis.
+ var dragTriggerXDistance = dx > 0 ? (util.dragThreshold + 1) : 0
+ var dragTriggerYDistance = dy > 0 ? (util.dragThreshold + 1) : 0
+ mouseMove(item, x + dragTriggerXDistance, y + dragTriggerYDistance, moveDelay, button)
if (ddx > 0 || ddy > 0) {
mouseMove(item, x + ddx, y + ddy, moveDelay, button)
mouseMove(item, x + 2*ddx, y + 2*ddy, moveDelay, button)