IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QNativeGestureEvent Class

The QNativeGestureEvent class contains parameters that describe a gesture event.

This class was introduced in Qt 5.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QNativeGestureEvent Class

  • Header: QNativeGestureEvent

  • Since: Qt 5.2

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Inherits: QSinglePointEvent

  • Group: QNativeGestureEvent is part of events

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

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

Member Function Documentation

 

[since 5.10] QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *device, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, qreal realValue, quint64 sequenceId, quint64 intValue)

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.

This function was introduced in Qt 5.10.

[since 5.2] Qt::NativeGestureType QNativeGestureEvent::gestureType() const

Returns the gesture type.

This function was introduced in Qt 5.2.

[since 5.2] qreal QNativeGestureEvent::value() const

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.

This function was introduced in Qt 5.2.

See Also

Obsolete Members for QNativeGestureEvent

The following members of class QNativeGestureEvent are deprecated. We strongly advise against using them in new code.

Obsolete Member Function Documentation

 
[since 5.2] const QPoint QNativeGestureEvent::globalPos() const

This function is deprecated. We strongly advise against using it in new code.

Use globalPosition().toPoint() instead.

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

This function was introduced in Qt 5.2.

[since 5.2] QPointF QNativeGestureEvent::localPos() const

This function is deprecated. We strongly advise against using it in new code.

Use position() instead.

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

This function was introduced in Qt 5.2.

[since 5.2] const QPoint QNativeGestureEvent::pos() const

This function is deprecated. We strongly advise against using it in new code.

Use position().toPoint() instead.

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

This function was introduced in Qt 5.2.

[since 5.2] QPointF QNativeGestureEvent::screenPos() const

This function is deprecated. We strongly advise against using it in new code.

Use globalPosition() instead.

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

This function was introduced in Qt 5.2.

[since 5.2] QPointF QNativeGestureEvent::windowPos() const

This function is deprecated. We strongly advise against using it in new code.

Use scenePosition() instead.

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

This function was introduced in Qt 5.2.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+