内容表

上一话题

QMovie

下一话题

QOffscreenSurface

QNativeGestureEvent

QNativeGestureEvent class contains parameters that describe a gesture event. 更多

Inheritance diagram of PySide2.QtGui.QNativeGestureEvent

概要

函数

详细描述

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

描述

Touch sequence

ZoomNativeGesture

Magnification delta in percent.

macOS: Two-finger pinch.

SmartZoomNativeGesture

布尔放大状态。

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

RotateNativeGesture

旋转增量 (以度为单位)。

macOS: Two-finger rotate.

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

BeginNativeGesture ZoomNativeGesture ZoomNativeGesture ZoomNativeGesture EndNativeGesture

另请参阅

NativeGestureType QGestureEvent

class QNativeGestureEvent ( type , localPos , windowPos , screenPos , value , sequenceId , intArgument )

注意

This constructor is deprecated.

QNativeGestureEvent(type, dev, localPos, windowPos, screenPos, value, sequenceId, intArgument)

param type

NativeGestureType

param localPos

QPointF

param screenPos

QPointF

param dev

QTouchDevice

param sequenceId

ulong

param windowPos

QPointF

param value

qreal

param intArgument

quint64

QTouchDevice parameter is now required

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

The points localPos , windowPos and screenPos specify the gesture position relative to the receiving widget or item, window, and screen, respectively.

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

PySide2.QtGui.QNativeGestureEvent. device ( )
返回类型

QTouchDevice

返回设备。

PySide2.QtGui.QNativeGestureEvent. gestureType ( )
返回类型

NativeGestureType

返回手势类型。

PySide2.QtGui.QNativeGestureEvent. globalPos ( )
返回类型

QPoint

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

PySide2.QtGui.QNativeGestureEvent. localPos ( )
返回类型

QPointF

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

PySide2.QtGui.QNativeGestureEvent. pos ( )
返回类型

QPoint

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

PySide2.QtGui.QNativeGestureEvent. screenPos ( )
返回类型

QPointF

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

PySide2.QtGui.QNativeGestureEvent. value ( )
返回类型

qreal

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.

PySide2.QtGui.QNativeGestureEvent. windowPos ( )
返回类型

QPointF

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