From 528b720d8f25c851b5e73b4159c20d70a47aefc0 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 7 May 2014 19:01:19 +0200 Subject: Introduce MouseArea.drag.smoothed [ChangeLog][QtQuick] Added property MouseArea.drag.smoothed for toggling whether the drag target is moved to the current mouse position after a drag operation has started. Task-number: QTBUG-38539 Change-Id: I989b51bc83fc24c64b84ac8e9a50b352e674e8f8 Reviewed-by: J-P Nurmi Reviewed-by: Alan Alpert --- src/quick/items/qquickmousearea.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquickmousearea.cpp') diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index 2d84660b6d..01d1305260 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -723,7 +723,9 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event) || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event, d->drag->threshold()))) { setKeepMouseGrab(true); d->stealMouse = true; - d->startScene = event->windowPos(); + + if (d->drag->smoothed()) + d->startScene = event->windowPos(); } d->moved = true; @@ -1250,6 +1252,10 @@ void QQuickMouseArea::setCursorShape(Qt::CursorShape shape) start. By default this is bound to a platform dependent value. This property was added in Qt Quick 2.2. + If \c drag.smoothed is \c true, the target will be moved only after the drag operation has + started. If set to \c false, the target will be moved straight to the current mouse position. + By default, this property is \c true. This property was added in Qt Quick 2.4 + \snippet qml/mousearea/mouseareadragfilter.qml dragfilter */ -- cgit v1.2.3