QNativeGestureEvent

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

Inheritance diagram of PySide6.QtGui.QNativeGestureEvent

Synopsis

Functions

Detailed Description

Native gesture events are generated by the operating system, typically by interpreting touch events. Gesture events are high-level events such as zoom or rotate.

Event Type

Description

Touch sequence

ZoomNativeGesture

Magnification delta in percent.

macOS: Two-finger pinch.

SmartZoomNativeGesture

Boolean magnification state.

macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).

RotateNativeGesture

Rotation delta in degrees.

macOS: Two-finger rotate.

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

BeginNativeGesture ZoomNativeGesture ZoomNativeGesture ZoomNativeGesture EndNativeGesture

See also

NativeGestureType QGestureEvent

class PySide6.QtGui.QNativeGestureEvent(type, dev, localPos, scenePos, globalPos, value, sequenceId, intArgument)

PySide6.QtGui.QNativeGestureEvent(arg__1)

Parameters

Constructs a native gesture event of type type originating from device.

The points localPos, scenePos and globalPos specify the gesture position relative to the receiving widget or item, window, and screen or desktop, respectively.

realValue is the macOS event parameter, sequenceId and intValue are the Windows event parameters.

PySide6.QtGui.QNativeGestureEvent.gestureType()
Return type

NativeGestureType

Returns the gesture type.

PySide6.QtGui.QNativeGestureEvent.globalPos()
Return type

PySide6.QtCore.QPoint

Note

This function is deprecated.

Returns the position of the gesture as a QPointF in screen coordinates

PySide6.QtGui.QNativeGestureEvent.localPos()
Return type

PySide6.QtCore.QPointF

Note

This function is deprecated.

Returns the position of the gesture as a QPointF , relative to the widget or item that received the event.

PySide6.QtGui.QNativeGestureEvent.pos()
Return type

PySide6.QtCore.QPoint

Note

This function is deprecated.

Returns the position of the mouse cursor, relative to the widget or item that received the event.

PySide6.QtGui.QNativeGestureEvent.screenPos()
Return type

PySide6.QtCore.QPointF

Note

This function is deprecated.

Returns the position of the gesture as a QPointF in screen coordinates.

PySide6.QtGui.QNativeGestureEvent.value()
Return type

float

Returns the gesture value. The value should be interpreted based on the gesture type. For example, a Zoom gesture provides a scale factor while a Rotate gesture provides a rotation delta.

PySide6.QtGui.QNativeGestureEvent.windowPos()
Return type

PySide6.QtCore.QPointF

Note

This function is deprecated.

Returns the position of the gesture as a QPointF , relative to the window that received the event.