diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-23 07:26:53 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-26 13:05:17 +0000 |
commit | 42d2d12e150ef92bfa08c3238fb8ddfb0e77fef1 (patch) | |
tree | 50466d28b257dcbfb7c33ed70d1d7508ab314df9 /src/quick/items/qquickevents_p_p.h | |
parent | d0922fcd0ac6707a46cbfd8422aeee5e36a49202 (diff) |
add QQuickEventPoint::sceneGrabPos property
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 <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickevents_p_p.h')
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
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<QObject> m_grabber; |