diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-15 16:11:59 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-23 14:47:16 +0000 |
commit | ad96378ba27d5a89cf447d912cdb8ae6cd6c34ec (patch) | |
tree | 3163c22c4553f48aed918757f944db8b3422d8c7 /src/quick/items/qquickevents.cpp | |
parent | 4e2392cf14d8c33bd8478f3a0e584946f6c5b151 (diff) |
add QQuickEventPoint::velocity property
Change-Id: Ifc3fc767546fc8d18ebaba0a07a1143239c2e194
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickevents.cpp')
-rw-r--r-- | src/quick/items/qquickevents.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 51a7e8aec7..7e84d27836 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -511,7 +511,7 @@ QQuickPointerDevice *QQuickPointerDevice::tabletDevice(qint64 id) return nullptr; } -void QQuickEventPoint::reset(Qt::TouchPointState state, QPointF scenePos, quint64 pointId, ulong timestamp) +void QQuickEventPoint::reset(Qt::TouchPointState state, QPointF scenePos, quint64 pointId, ulong timestamp, QVector2D velocity) { m_scenePos = scenePos; m_pointId = pointId; @@ -521,7 +521,8 @@ void QQuickEventPoint::reset(Qt::TouchPointState state, QPointF scenePos, quint6 m_timestamp = timestamp; if (state == Qt::TouchPointPressed) m_pressTimestamp = timestamp; - // TODO calculate velocity + // TODO if Q_LIKELY(velocity.isNull) calculate velocity + m_velocity = velocity; } QQuickItem *QQuickEventPoint::grabber() const @@ -548,7 +549,7 @@ QQuickEventTouchPoint::QQuickEventTouchPoint(QQuickPointerTouchEvent *parent) void QQuickEventTouchPoint::reset(const QTouchEvent::TouchPoint &tp, ulong timestamp) { - QQuickEventPoint::reset(tp.state(), tp.scenePos(), tp.id(), timestamp); + QQuickEventPoint::reset(tp.state(), tp.scenePos(), tp.id(), timestamp, tp.velocity()); m_rotation = tp.rotation(); m_pressure = tp.pressure(); m_uniqueId = tp.uniqueId(); |