QNativeGestureEvent¶
The
QNativeGestureEventclass contains parameters that describe a gesture event. More…

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
ZoomNativeGestureMagnification delta in percent.
macOS: Two-finger pinch.
SmartZoomNativeGestureBoolean magnification state.
macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
RotateNativeGestureRotation 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
NativeGestureTypeQGestureEvent
- class PySide2.QtGui.QNativeGestureEvent(type, localPos, windowPos, screenPos, value, sequenceId, intArgument)¶
Note
This constructor is deprecated.
PySide2.QtGui.QNativeGestureEvent(type, dev, localPos, windowPos, screenPos, value, sequenceId, intArgument)
- param type:
- param localPos:
- param screenPos:
- param dev:
- param sequenceId:
ulong- param windowPos:
- param value:
float
- param intArgument:
int
The
QTouchDeviceparameter is now requiredConstructs a native gesture event of type
typeoriginating fromdevice.The points
localPos,windowPosandscreenPosspecify the gesture position relative to the receiving widget or item, window, and screen, respectively.realValueis the macOS event parameter,sequenceIdandintValueare the Windows event parameters.
- PySide2.QtGui.QNativeGestureEvent.device()¶
- Return type:
Returns the device.
- PySide2.QtGui.QNativeGestureEvent.gestureType()¶
- Return type:
Returns the gesture type.
- PySide2.QtGui.QNativeGestureEvent.globalPos()¶
- Return type:
Returns the position of the gesture as a
QPointFin screen coordinates
- PySide2.QtGui.QNativeGestureEvent.localPos()¶
- Return type:
Returns the position of the gesture as a
QPointF, relative to the widget or item that received the event.
- PySide2.QtGui.QNativeGestureEvent.pos()¶
- Return type:
Returns the position of the mouse cursor, relative to the widget or item that received the event.
- PySide2.QtGui.QNativeGestureEvent.screenPos()¶
- Return type:
Returns the position of the gesture as a
QPointFin screen coordinates.
- PySide2.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.
See also
- PySide2.QtGui.QNativeGestureEvent.windowPos()¶
- Return type:
Returns the position of the gesture as a
QPointF, relative to the window that received the event.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.