CopperSpice API  1.9.1
QNativeGestureEvent Class Reference

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

Inheritance diagram for QNativeGestureEvent:
QInputEvent QEvent

Public Methods

 QNativeGestureEvent (Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue)
 
Qt::NativeGestureType gestureType () const
 
const QPoint globalPos () const
 
const QPointFlocalPos () const
 
const QPoint pos () const
 
const QPointFscreenPos () const
 
qreal value () const
 
const QPointFwindowPos () const
 
- Public Methods inherited from QInputEvent
Qt::KeyboardModifiers modifiers () const
 
void setModifiers (Qt::KeyboardModifiers modifiers)
 
void setTimestamp (ulong timestamp)
 
ulong timestamp () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Public Types inherited from QEvent
enum  Type
 
- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

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.

BeginNativeGesture and EndNativeGesture are sent before and after gesture event streams: BeginNativeGesture ZoomNativeGesture ZoomNativeGesture ZoomNativeGesture EndNativeGesture.

Event Type Description Touch Sequence
Qt::ZoomNativeGesture Magnification delta in percent macOS: Two-finger pinch
Qt::SmartZoomNativeGesture Boolean magnification state macOS: Two-finger double tap (trackpad) / One-finger double tap (magic mouse).
Qt::RotateNativeGesture Rotation delta in degrees macOS: Two-finger rotate
See also
Qt::NativeGestureType, QGestureEvent

Constructor & Destructor Documentation

QNativeGestureEvent::QNativeGestureEvent ( Qt::NativeGestureType  type,
const QPointF localPos,
const QPointF windowPos,
const QPointF screenPos,
qreal  realValue,
ulong  sequenceId,
quint64  intValue 
)

Constructs a native gesture event of the given type. The points localPos, windowPos, and screenPos specify the gesture position relative to the receiving widget or item, window, and screen, respectively. The realValue is the macOS event parameter, sequenceId and intValue are the Windows event parameters.

Method Documentation

Qt::NativeGestureType QNativeGestureEvent::gestureType ( ) const
inline

Returns the gesture type.

const QPoint QNativeGestureEvent::globalPos ( ) const
inline

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

const QPointF & QNativeGestureEvent::localPos ( ) const
inline

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

const QPoint QNativeGestureEvent::pos ( ) const
inline

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

const QPointF & QNativeGestureEvent::screenPos ( ) const
inline

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

qreal QNativeGestureEvent::value ( ) const
inline

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
gestureType()
const QPointF & QNativeGestureEvent::windowPos ( ) const
inline

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