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/qwindowsysteminterface.cpp | |
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/qwindowsysteminterface.cpp')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 70db73b5d3..355ebb87ec 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -1056,14 +1056,14 @@ bool QWindowSystemInterface::handleGestureEventWithRealValue(QWindow *window, ul return QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } -bool QWindowSystemInterface::handleGestureEventWithValueAndDeltas(QWindow *window, ulong timestamp, const QPointingDevice *device, - Qt::NativeGestureType type, qreal value, const QPointF &deltas, - const QPointF &local, const QPointF &global, int fingerCount) +bool QWindowSystemInterface::handleGestureEventWithValueAndDelta(QWindow *window, ulong timestamp, const QPointingDevice *device, + Qt::NativeGestureType type, qreal value, const QPointF &delta, + const QPointF &local, const QPointF &global, int fingerCount) { QWindowSystemInterfacePrivate::GestureEvent *e = new QWindowSystemInterfacePrivate::GestureEvent(window, timestamp, type, device, fingerCount, local, global); e->realValue = value; - e->deltas = deltas; + e->delta = delta; return QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } #endif // QT_NO_GESTURES |