diff options
author | Kevin Funk <kevin.funk@kdab.com> | 2014-05-07 19:01:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-14 14:05:46 +0200 |
commit | 528b720d8f25c851b5e73b4159c20d70a47aefc0 (patch) | |
tree | 07f895d250848be72811c5cea776d8bab239e340 /src/quick/items/qquickmousearea.cpp | |
parent | cf7166e266e20d3da940b9f58d8631d23cc38482 (diff) |
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 <jpnurmi@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquickmousearea.cpp')
-rw-r--r-- | src/quick/items/qquickmousearea.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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 */ |