From 42d2d12e150ef92bfa08c3238fb8ddfb0e77fef1 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 23 Aug 2016 07:26:53 +0200 Subject: add QQuickEventPoint::sceneGrabPos property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some handlers need to track total movement of the points from the time that the gesture begins. So far it seems that will always be the same as the moment that the handler decides to grab; so it's enough to store a copy of the current position when the grab occurs. Also change setGrabber to call either setItemGrabber or setPointerHandlerGrabber so that we only need to add new features like this one in two places instead of three. Change-Id: Ia944bf27302fc305a21957e8b02174909c024a90 Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickevents_p_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/quick/items/qquickevents_p_p.h') diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 5e663a4680..66393170ac 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -252,6 +252,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickEventPoint : public QObject Q_OBJECT Q_PROPERTY(QPointF scenePos READ scenePos) Q_PROPERTY(QPointF scenePressPos READ scenePressPos) + Q_PROPERTY(QPointF sceneGrabPos READ sceneGrabPos) Q_PROPERTY(QVector2D velocity READ velocity) Q_PROPERTY(State state READ state) Q_PROPERTY(quint64 pointId READ pointId) @@ -278,6 +279,7 @@ public: QQuickPointerEvent *pointerEvent() const; QPointF scenePos() const { return m_scenePos; } QPointF scenePressPos() const { return m_scenePressPos; } + QPointF sceneGrabPos() const { return m_sceneGrabPos; } QVector2D velocity() const { return m_velocity; } State state() const { return m_state; } quint64 pointId() const { return m_pointId; } @@ -297,6 +299,7 @@ public: private: QPointF m_scenePos; QPointF m_scenePressPos; + QPointF m_sceneGrabPos; QVector2D m_velocity; quint64 m_pointId; QPointer m_grabber; -- cgit v1.2.3