diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2013-03-14 12:36:20 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-14 10:30:06 +0100 |
commit | f52227f66a7af5692140ad036c06857cd2e7abcf (patch) | |
tree | 465b0cd7a9d23b4921a508cdb6f3e3504dbcc3a5 /tests/auto/qmltest/events | |
parent | b58953fae3dc80c52e846d2d87856dd20b8986ab (diff) |
Smooth dragging an item with MouseArea.
Calculate drag distance relative to the mouse position when a drag is
detected rather than the press position so there isn't a large change
in position on the first move.
Task-number: QTBUG-30188
Change-Id: I5c2269c2228668a3842e18f65167637497b3beb4
Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
Diffstat (limited to 'tests/auto/qmltest/events')
-rw-r--r-- | tests/auto/qmltest/events/tst_drag.qml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/qmltest/events/tst_drag.qml b/tests/auto/qmltest/events/tst_drag.qml index 7a17007495..70e0ea2096 100644 --- a/tests/auto/qmltest/events/tst_drag.qml +++ b/tests/auto/qmltest/events/tst_drag.qml @@ -47,6 +47,10 @@ Rectangle{ width:200 height:200 + TestUtil { + id: util + } + Rectangle { id:container width:20 @@ -67,8 +71,8 @@ Rectangle{ when:windowShown function test_mouseDrag() { mouseDrag(container, 10, 10, 20, 30); - compare(container.x, 20); - compare(container.y, 30); + compare(container.x, 20 - util.dragThreshold - 1); + compare(container.y, 30 - util.dragThreshold - 1); } } -}
\ No newline at end of file +} |