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 /src/quick/items/qquickmousearea.cpp | |
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 'src/quick/items/qquickmousearea.cpp')
-rw-r--r-- | src/quick/items/qquickmousearea.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index 2fa52d9ed2..ad0a265035 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -828,6 +828,7 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event) || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event))) { setKeepMouseGrab(true); d->stealMouse = true; + d->startScene = event->windowPos(); } d->moved = true; |