From f52227f66a7af5692140ad036c06857cd2e7abcf Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 14 Mar 2013 12:36:20 +1000 Subject: 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 --- src/quick/items/qquickmousearea.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/items/qquickmousearea.cpp') 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; -- cgit v1.2.3