diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-07-13 13:06:11 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-07-14 17:14:23 +0200 |
commit | de540c283d96630c189df9c9be37f68ad8285056 (patch) | |
tree | 9da0cfdd123cc1853c45721f92e0e3a334f84bba /src/gui/kernel/qevent.h | |
parent | e3aa45006dc883adb92b4c94a0108d3b75012dce (diff) |
Rename QNativeGestureEvent::deltas() to delta(); clarify docs
In QPanGesture this is called delta().
OTOH we have QWheelEvent::pixelDeltas().
Delta is a vector, and there's only one (with two components).
Native gestures hold incremental values: e.g. the pinch gesture event
provides an incremental amount of either zooming or rotation (so most
events have QNativeGestureEvent::value() very close to 0).
It's the same with the pan gesture's delta().
Add better docs for swipe and pan gestures.
Change-Id: Ia147c7c9a22e084c3700b1620dec46427d792bd1
Reviewed-by: Povilas Kanapickas <povilas@radix.lt>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 374e94bf35..9796886ae1 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -424,7 +424,7 @@ public: Qt::NativeGestureType gestureType() const { return m_gestureType; } int fingerCount() const { return m_fingerCount; } qreal value() const { return m_realValue; } - QPointF deltas() const { return m_deltas.toPointF(); } + QPointF delta() const { return m_delta.toPointF(); } #if QT_DEPRECATED_SINCE(6, 0) #ifndef QT_NO_INTEGER_EVENT_COORDINATES @@ -443,7 +443,7 @@ public: protected: quint64 m_sequenceId; - QVector2D m_deltas; + QVector2D m_delta; qreal m_realValue; Qt::NativeGestureType m_gestureType; quint32 m_fingerCount : 4; |