aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/testlib/TestCase.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/testlib/TestCase.qml')
-rw-r--r--src/imports/testlib/TestCase.qml14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index f9a1a4918c..fbfad28209 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -441,9 +441,23 @@ Item {
if (delay == undefined)
delay = -1
+ // Divide dx and dy to have intermediate mouseMove while dragging
+ // Fractions of dx/dy need be superior to the dragThreshold
+ // to make the drag works though
+ var ddx = Math.round(dx/3)
+ if (ddx < (util.dragThreshold + 1))
+ ddx = 0
+ var ddy = Math.round(dy/3)
+ if (ddy < (util.dragThreshold + 1))
+ ddy = 0
+
mousePress(item, x, y, button, modifiers, delay)
//trigger dragging
mouseMove(item, x + util.dragThreshold + 1, y + util.dragThreshold + 1, delay, button)
+ if (ddx > 0 || ddy > 0) {
+ mouseMove(item, x + ddx, y + ddy, delay, button)
+ mouseMove(item, x + 2*ddx, y + 2*ddy, delay, button)
+ }
mouseMove(item, x + dx, y + dy, delay, button)
mouseRelease(item, x + dx, y + dy, button, modifiers, delay)
}