#[repr(C)]
pub struct QNativeGestureEvent { /* private fields */ }
Expand description

The QNativeGestureEvent class contains parameters that describe a gesture event.

C++ class: QNativeGestureEvent.

C++ documentation:

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 TypeDescriptionTouch equence
Qt::ZoomNativeGestureMagnification delta in percent.macOS: Two-finger pinch.
Qt::SmartZoomNativeGestureBoolean magnification state.macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
Qt::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

Implementations§

source§

impl QNativeGestureEvent

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QNativeGestureEvent>> ) -> Ref<QNativeGestureEvent>

The QNativeGestureEvent class contains parameters that describe a gesture event.

Calls C++ function: QNativeGestureEvent& QNativeGestureEvent::operator=(const QNativeGestureEvent& other).

C++ documentation:

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 TypeDescriptionTouch equence
Qt::ZoomNativeGestureMagnification delta in percent.macOS: Two-finger pinch.
Qt::SmartZoomNativeGestureBoolean magnification state.macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
Qt::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

source

pub unsafe fn device(&self) -> Ptr<QTouchDevice>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the device.

Calls C++ function: const QTouchDevice* QNativeGestureEvent::device() const.

C++ documentation:

Returns the device.

This function was introduced in Qt 5.10.

source

pub unsafe fn gesture_type(&self) -> NativeGestureType

Returns the gesture type.

Calls C++ function: Qt::NativeGestureType QNativeGestureEvent::gestureType() const.

C++ documentation:

Returns the gesture type.

This function was introduced in Qt 5.2.

source

pub unsafe fn global_pos(&self) -> CppBox<QPoint>

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

Calls C++ function: QPoint QNativeGestureEvent::globalPos() const.

C++ documentation:

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

This function was introduced in Qt 5.2.

source

pub unsafe fn local_pos(&self) -> Ref<QPointF>

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

Calls C++ function: const QPointF& QNativeGestureEvent::localPos() const.

C++ documentation:

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.

source

pub unsafe fn new_7a( type_: NativeGestureType, local_pos: impl CastInto<Ref<QPointF>>, window_pos: impl CastInto<Ref<QPointF>>, screen_pos: impl CastInto<Ref<QPointF>>, value: c_double, sequence_id: c_ulong, int_argument: u64 ) -> CppBox<QNativeGestureEvent>

Constructs a native gesture event of type type.

Calls C++ function: [constructor] void QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointF& localPos, const QPointF& windowPos, const QPointF& screenPos, double value, unsigned long sequenceId, quint64 intArgument).

C++ documentation:

Constructs a native gesture event of type type.

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.

source

pub unsafe fn new_8a( type_: NativeGestureType, dev: impl CastInto<Ptr<QTouchDevice>>, local_pos: impl CastInto<Ref<QPointF>>, window_pos: impl CastInto<Ref<QPointF>>, screen_pos: impl CastInto<Ref<QPointF>>, value: c_double, sequence_id: c_ulong, int_argument: u64 ) -> CppBox<QNativeGestureEvent>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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

Calls C++ function: [constructor] void QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QTouchDevice* dev, const QPointF& localPos, const QPointF& windowPos, const QPointF& screenPos, double value, unsigned long sequenceId, quint64 intArgument).

C++ documentation:

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.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QNativeGestureEvent>> ) -> CppBox<QNativeGestureEvent>

The QNativeGestureEvent class contains parameters that describe a gesture event.

Calls C++ function: [constructor] void QNativeGestureEvent::QNativeGestureEvent(const QNativeGestureEvent& other).

C++ documentation:

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 TypeDescriptionTouch equence
Qt::ZoomNativeGestureMagnification delta in percent.macOS: Two-finger pinch.
Qt::SmartZoomNativeGestureBoolean magnification state.macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
Qt::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

source

pub unsafe fn pos(&self) -> CppBox<QPoint>

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

Calls C++ function: QPoint QNativeGestureEvent::pos() const.

C++ documentation:

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.

source

pub unsafe fn screen_pos(&self) -> Ref<QPointF>

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

Calls C++ function: const QPointF& QNativeGestureEvent::screenPos() const.

C++ documentation:

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

This function was introduced in Qt 5.2.

source

pub unsafe fn value(&self) -> c_double

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.

Calls C++ function: double QNativeGestureEvent::value() const.

C++ documentation:

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 QNativeGestureEvent and gestureType().

source

pub unsafe fn window_pos(&self) -> Ref<QPointF>

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

Calls C++ function: const QPointF& QNativeGestureEvent::windowPos() const.

C++ documentation:

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.

Methods from Deref<Target = QInputEvent>§

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QInputEvent>> ) -> Ref<QInputEvent>

The QInputEvent class is the base class for events that describe user input.

Calls C++ function: QInputEvent& QInputEvent::operator=(const QInputEvent& other).

C++ documentation:

The QInputEvent class is the base class for events that describe user input.

source

pub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>

Returns the keyboard modifier flags that existed immediately before the event occurred.

Calls C++ function: QFlags<Qt::KeyboardModifier> QInputEvent::modifiers() const.

C++ documentation:

Returns the keyboard modifier flags that existed immediately before the event occurred.

See also QGuiApplication::keyboardModifiers().

source

pub unsafe fn set_modifiers(&self, amodifiers: QFlags<KeyboardModifier>)

Calls C++ function: void QInputEvent::setModifiers(QFlags<Qt::KeyboardModifier> amodifiers).

source

pub unsafe fn set_timestamp(&self, atimestamp: c_ulong)

Calls C++ function: void QInputEvent::setTimestamp(unsigned long atimestamp).

source

pub unsafe fn timestamp(&self) -> c_ulong

Returns the window system's timestamp for this event. It will normally be in milliseconds since some arbitrary point in time, such as the time when the system was started.

Calls C++ function: unsigned long QInputEvent::timestamp() const.

C++ documentation:

Returns the window system’s timestamp for this event. It will normally be in milliseconds since some arbitrary point in time, such as the time when the system was started.

Methods from Deref<Target = QEvent>§

source

pub unsafe fn accept(&self)

Sets the accept flag of the event object, the equivalent of calling setAccepted(true).

Calls C++ function: void QEvent::accept().

C++ documentation:

Sets the accept flag of the event object, the equivalent of calling setAccepted(true).

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.

See also ignore().

source

pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>

Calls C++ function: QEvent& QEvent::operator=(const QEvent& other).

source

pub unsafe fn ignore(&self)

Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).

Calls C++ function: void QEvent::ignore().

C++ documentation:

Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).

Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propagated to the parent widget.

See also accept().

source

pub unsafe fn is_accepted(&self) -> bool

the accept flag of the event object

Calls C++ function: bool QEvent::isAccepted() const.

C++ documentation:

the accept flag of the event object

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.

For convenience, the accept flag can also be set with accept(), and cleared with ignore().

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)
source

pub unsafe fn set_accepted(&self, accepted: bool)

the accept flag of the event object

Calls C++ function: void QEvent::setAccepted(bool accepted).

C++ documentation:

the accept flag of the event object

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.

For convenience, the accept flag can also be set with accept(), and cleared with ignore().

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)
source

pub unsafe fn spontaneous(&self) -> bool

Returns true if the event originated outside the application (a system event); otherwise returns false.

Calls C++ function: bool QEvent::spontaneous() const.

C++ documentation:

Returns true if the event originated outside the application (a system event); otherwise returns false.

The return value of this function is not defined for paint events.

source

pub unsafe fn type_(&self) -> Type

Returns the event type.

Calls C++ function: QEvent::Type QEvent::type() const.

C++ documentation:

Returns the event type.

Trait Implementations§

source§

impl CppDeletable for QNativeGestureEvent

source§

unsafe fn delete(&self)

The QNativeGestureEvent class contains parameters that describe a gesture event.

Calls C++ function: [destructor] void QNativeGestureEvent::~QNativeGestureEvent().

C++ documentation:

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 TypeDescriptionTouch equence
Qt::ZoomNativeGestureMagnification delta in percent.macOS: Two-finger pinch.
Qt::SmartZoomNativeGestureBoolean magnification state.macOS: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
Qt::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

source§

impl Deref for QNativeGestureEvent

source§

fn deref(&self) -> &QInputEvent

Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QNativeGestureEvent* ptr).

§

type Target = QInputEvent

The resulting type after dereferencing.
source§

impl DynamicCast<QNativeGestureEvent> for QEvent

source§

unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QNativeGestureEvent>

Calls C++ function: QNativeGestureEvent* dynamic_cast<QNativeGestureEvent*>(QEvent* ptr).

source§

impl DynamicCast<QNativeGestureEvent> for QInputEvent

source§

unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QNativeGestureEvent>

Calls C++ function: QNativeGestureEvent* dynamic_cast<QNativeGestureEvent*>(QInputEvent* ptr).

source§

impl StaticDowncast<QNativeGestureEvent> for QEvent

source§

unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QNativeGestureEvent>

Calls C++ function: QNativeGestureEvent* static_cast<QNativeGestureEvent*>(QEvent* ptr).

source§

impl StaticDowncast<QNativeGestureEvent> for QInputEvent

source§

unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QNativeGestureEvent>

Calls C++ function: QNativeGestureEvent* static_cast<QNativeGestureEvent*>(QInputEvent* ptr).

source§

impl StaticUpcast<QEvent> for QNativeGestureEvent

source§

unsafe fn static_upcast(ptr: Ptr<QNativeGestureEvent>) -> Ptr<QEvent>

Calls C++ function: QEvent* static_cast<QEvent*>(QNativeGestureEvent* ptr).

source§

impl StaticUpcast<QInputEvent> for QNativeGestureEvent

source§

unsafe fn static_upcast(ptr: Ptr<QNativeGestureEvent>) -> Ptr<QInputEvent>

Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QNativeGestureEvent* ptr).

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.