Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QNativeGestureEvent Class Reference

The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui. More...

Collaboration diagram for QNativeGestureEvent:

Detailed Description

The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.

Since
5.2

Native gesture events are generated by the operating system, typically by interpreting trackpad touch events. Gesture events are high-level events such as zoom, rotate or pan. Several types hold incremental values: that is, value() and delta() provide the difference from the previous event to the current event.

\table \header

  • Event Type
  • Description
  • Touch sequence \row
  • Qt::ZoomNativeGesture
  • Magnification delta in percent.
  • \macos, Wayland, Windows and X11: Two-finger pinch. \row
  • Qt::SmartZoomNativeGesture
  • Boolean magnification state.
  • \macos: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse). \row
  • Qt::RotateNativeGesture
  • Rotation delta in degrees.
  • \macos and Wayland: Two-finger rotate. \row
  • Qt::SwipeNativeGesture
  • Swipe angle in degrees.
  • \macos: Configurable in trackpad settings. \row
  • Qt::PanNativeGesture
  • Displacement delta in pixels.
  • Wayland: Three or more fingers moving as a group, in any direction. \endtable

In addition, BeginNativeGesture and EndNativeGesture are sent before and after gesture event streams:

BeginNativeGesture
ZoomNativeGesture
ZoomNativeGesture
ZoomNativeGesture
EndNativeGesture

The event stream may include interleaved gestures of different types: for example the two-finger pinch gesture generates a stream of Zoom and Rotate events, and PanNativeGesture may sometimes be interleaved with those, depending on the platform.

Other types are standalone events: SmartZoomNativeGesture and SwipeNativeGesture occur only once each time the gesture is detected.

Note
On a touchpad, moving two fingers as a group (the two-finger flick gesture) is usually reserved for scrolling; in that case, Qt generates QWheelEvents. This is the reason that three or more fingers are needed to generate a PanNativeGesture.
See also
Qt::NativeGestureType, QGestureEvent, QWheelEvent

The documentation for this class was generated from the following file: