diff options
author | Kevin Funk <[email protected]> | 2014-05-07 19:01:19 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-05-14 14:05:46 +0200 |
commit | 528b720d8f25c851b5e73b4159c20d70a47aefc0 (patch) | |
tree | 07f895d250848be72811c5cea776d8bab239e340 /src/quick/items/qquickdrag.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 <[email protected]>
Reviewed-by: Alan Alpert <[email protected]>
Diffstat (limited to 'src/quick/items/qquickdrag.cpp')
-rw-r--r-- | src/quick/items/qquickdrag.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 6c36032d3c..7e5b357e9c 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -791,7 +791,7 @@ void QQuickDragAttached::startDrag(QQmlV4Function *args) QQuickDrag::QQuickDrag(QObject *parent) : QObject(parent), _target(0), _axis(XAndYAxis), _xmin(-FLT_MAX), _xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX), _active(false), _filterChildren(false), - _threshold(qApp->styleHints()->startDragDistance()) + _smoothed(true), _threshold(qApp->styleHints()->startDragDistance()) { } @@ -885,6 +885,18 @@ void QQuickDrag::setYmax(qreal m) emit maximumYChanged(); } +bool QQuickDrag::smoothed() const +{ + return _smoothed; +} + +void QQuickDrag::setSmoothed(bool smooth) +{ + if (_smoothed != smooth) { + _smoothed = smooth; + emit smoothedChanged(); + } +} qreal QQuickDrag::threshold() const { |