diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-11 07:38:46 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-19 10:56:06 +0000 |
commit | ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 (patch) | |
tree | af1b30bffea87bedb23e8cd795f23692f29b50a9 /src/quick/handlers/qquickmultipointhandler_p.h | |
parent | d310ca768bb5f45bae4fcec9a5d8151b6a366b8d (diff) |
Make DragHandler a MultiPointHandler
That is, minimumPointCount can now be set to a value > 1 to require
multiple fingers to do the dragging, or to track the displacement
of multiple fingers to adjust some value (such as the tilt of a map).
Task-number: QTBUG-68106
Change-Id: Ib35823e36deb81c8b277d3070fcc758c7c019564
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickmultipointhandler_p.h')
-rw-r--r-- | src/quick/handlers/qquickmultipointhandler_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickmultipointhandler_p.h b/src/quick/handlers/qquickmultipointhandler_p.h index d1cf67b2cb..80f6917d24 100644 --- a/src/quick/handlers/qquickmultipointhandler_p.h +++ b/src/quick/handlers/qquickmultipointhandler_p.h @@ -66,7 +66,7 @@ class Q_AUTOTEST_EXPORT QQuickMultiPointHandler : public QQuickPointerDeviceHand Q_PROPERTY(QQuickHandlerPoint centroid READ centroid NOTIFY centroidChanged) public: - explicit QQuickMultiPointHandler(QObject *parent = nullptr, int minimumPointCount = 2); + explicit QQuickMultiPointHandler(QObject *parent = nullptr, int minimumPointCount = 2, int maximumPointCount = -1); ~QQuickMultiPointHandler(); int minimumPointCount() const { return m_minimumPointCount; } @@ -94,6 +94,7 @@ protected: bool wantsPointerEvent(QQuickPointerEvent *event) override; void handlePointerEventImpl(QQuickPointerEvent *event) override; void onActiveChanged() override; + void onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabState stateChange, QQuickEventPoint *point) override; bool hasCurrentPoints(QQuickPointerEvent *event); QVector<QQuickEventPoint *> eligiblePoints(QQuickPointerEvent *event); qreal averageTouchPointDistance(const QPointF &ref); @@ -104,6 +105,7 @@ protected: static qreal averageAngleDelta(const QVector<PointData> &old, const QVector<PointData> &newAngles); void acceptPoints(const QVector<QQuickEventPoint *> &points); bool grabPoints(QVector<QQuickEventPoint *> points); + void moveTarget(QPointF pos); protected: QVector<QQuickHandlerPoint> m_currentPoints; |