QNativeGestureEvent Class
The QNativeGestureEvent class contains parameters that describe a gesture event. More...
Header: | #include <QNativeGestureEvent> |
qmake: | QT += gui |
Since: | Qt 5.2 |
Inherits: | QInputEvent |
Public Functions
QNativeGestureEvent(Qt::NativeGestureType type, const QTouchDevice *device, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue) | |
virtual | ~QNativeGestureEvent() |
const QTouchDevice * | device() const |
Qt::NativeGestureType | gestureType() const |
const QPoint | globalPos() const |
const QPointF & | localPos() const |
const QPoint | pos() const |
const QPointF & | screenPos() const |
qreal | value() const |
const QPointF & | windowPos() const |
- 4 public functions inherited from QInputEvent
- 6 public functions inherited from QEvent
Protected Variables
Qt::NativeGestureType | mGestureType |
quint64 | mIntValue |
QPointF | mLocalPos |
qreal | mRealValue |
QPointF | mScreenPos |
ulong | mSequenceId |
QPointF | mWindowPos |
Additional Inherited Members
Detailed Description
The QNativeGestureEvent class contains parameters that describe a gesture event.
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 |
---|---|---|
Qt::ZoomNativeGesture | Magnification delta in percent. | macOS: Two-finger pinch. |
Qt::SmartZoomNativeGesture | Boolean magnification state. | macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse). |
Qt::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 Qt::NativeGestureType and QGestureEvent.
Member Function Documentation
QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QTouchDevice *device, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue)
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.
This function was introduced in Qt 5.10.
[virtual]
QNativeGestureEvent::~QNativeGestureEvent()
Destroys the instance of QNativeGestureEvent. The destructor is virtual.
const QTouchDevice *QNativeGestureEvent::device() const
Returns the device.
This function was introduced in Qt 5.10.