Struct qt_gui::QNativeGestureEvent
source · #[repr(C)]pub struct QNativeGestureEvent { /* private fields */ }
Expand description
The QNativeGestureEvent class contains parameters that describe a gesture event.
C++ class: QNativeGestureEvent
.
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 equence |
---|---|---|
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
Implementations§
source§impl QNativeGestureEvent
impl QNativeGestureEvent
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QNativeGestureEvent>>
) -> Ref<QNativeGestureEvent>
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)
.
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 equence |
---|---|---|
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
sourcepub 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.
pub unsafe fn device(&self) -> Ptr<QTouchDevice>
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
.
Returns the device.
This function was introduced in Qt 5.10.
sourcepub unsafe fn gesture_type(&self) -> NativeGestureType
pub unsafe fn gesture_type(&self) -> NativeGestureType
Returns the gesture type.
Calls C++ function: Qt::NativeGestureType QNativeGestureEvent::gestureType() const
.
Returns the gesture type.
This function was introduced in Qt 5.2.
sourcepub unsafe fn global_pos(&self) -> CppBox<QPoint>
pub unsafe fn global_pos(&self) -> CppBox<QPoint>
sourcepub unsafe fn local_pos(&self) -> Ref<QPointF>
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
.
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.
sourcepub 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>
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)
.
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.
sourcepub 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.
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>
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)
.
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.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QNativeGestureEvent>>
) -> CppBox<QNativeGestureEvent>
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)
.
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 equence |
---|---|---|
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
sourcepub unsafe fn pos(&self) -> CppBox<QPoint>
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
.
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.
sourcepub unsafe fn screen_pos(&self) -> Ref<QPointF>
pub unsafe fn screen_pos(&self) -> Ref<QPointF>
sourcepub unsafe fn value(&self) -> c_double
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
.
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().
sourcepub unsafe fn window_pos(&self) -> Ref<QPointF>
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
.
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>§
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QInputEvent>>
) -> Ref<QInputEvent>
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)
.
The QInputEvent class is the base class for events that describe user input.
sourcepub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>
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
.
Returns the keyboard modifier flags that existed immediately before the event occurred.
See also QGuiApplication::keyboardModifiers().
sourcepub unsafe fn set_modifiers(&self, amodifiers: QFlags<KeyboardModifier>)
pub unsafe fn set_modifiers(&self, amodifiers: QFlags<KeyboardModifier>)
Calls C++ function: void QInputEvent::setModifiers(QFlags<Qt::KeyboardModifier> amodifiers)
.
sourcepub unsafe fn set_timestamp(&self, atimestamp: c_ulong)
pub unsafe fn set_timestamp(&self, atimestamp: c_ulong)
Calls C++ function: void QInputEvent::setTimestamp(unsigned long atimestamp)
.
sourcepub unsafe fn timestamp(&self) -> c_ulong
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
.
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>§
sourcepub unsafe fn accept(&self)
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()
.
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().
sourcepub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
Calls C++ function: QEvent& QEvent::operator=(const QEvent& other)
.
sourcepub unsafe fn ignore(&self)
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()
.
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().
sourcepub unsafe fn is_accepted(&self) -> bool
pub unsafe fn is_accepted(&self) -> bool
the accept flag of the event object
Calls C++ function: bool QEvent::isAccepted() const
.
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) |
sourcepub unsafe fn set_accepted(&self, accepted: bool)
pub unsafe fn set_accepted(&self, accepted: bool)
the accept flag of the event object
Calls C++ function: void QEvent::setAccepted(bool accepted)
.
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) |
sourcepub unsafe fn spontaneous(&self) -> bool
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
.
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.
Trait Implementations§
source§impl CppDeletable for QNativeGestureEvent
impl CppDeletable for QNativeGestureEvent
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QNativeGestureEvent class contains parameters that describe a gesture event.
Calls C++ function: [destructor] void QNativeGestureEvent::~QNativeGestureEvent()
.
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 equence |
---|---|---|
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
source§impl Deref for QNativeGestureEvent
impl Deref for QNativeGestureEvent
source§fn deref(&self) -> &QInputEvent
fn deref(&self) -> &QInputEvent
Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QNativeGestureEvent* ptr)
.
§type Target = QInputEvent
type Target = QInputEvent
source§impl DynamicCast<QNativeGestureEvent> for QEvent
impl DynamicCast<QNativeGestureEvent> for QEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QNativeGestureEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QNativeGestureEvent>
Calls C++ function: QNativeGestureEvent* dynamic_cast<QNativeGestureEvent*>(QEvent* ptr)
.
source§impl DynamicCast<QNativeGestureEvent> for QInputEvent
impl DynamicCast<QNativeGestureEvent> for QInputEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QNativeGestureEvent>
unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QNativeGestureEvent>
Calls C++ function: QNativeGestureEvent* dynamic_cast<QNativeGestureEvent*>(QInputEvent* ptr)
.
source§impl StaticDowncast<QNativeGestureEvent> for QEvent
impl StaticDowncast<QNativeGestureEvent> for QEvent
source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QNativeGestureEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QNativeGestureEvent>
Calls C++ function: QNativeGestureEvent* static_cast<QNativeGestureEvent*>(QEvent* ptr)
.
source§impl StaticDowncast<QNativeGestureEvent> for QInputEvent
impl StaticDowncast<QNativeGestureEvent> for QInputEvent
source§unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QNativeGestureEvent>
unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QNativeGestureEvent>
Calls C++ function: QNativeGestureEvent* static_cast<QNativeGestureEvent*>(QInputEvent* ptr)
.
source§impl StaticUpcast<QEvent> for QNativeGestureEvent
impl StaticUpcast<QEvent> for QNativeGestureEvent
source§unsafe fn static_upcast(ptr: Ptr<QNativeGestureEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QNativeGestureEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QNativeGestureEvent* ptr)
.
source§impl StaticUpcast<QInputEvent> for QNativeGestureEvent
impl StaticUpcast<QInputEvent> for QNativeGestureEvent
source§unsafe fn static_upcast(ptr: Ptr<QNativeGestureEvent>) -> Ptr<QInputEvent>
unsafe fn static_upcast(ptr: Ptr<QNativeGestureEvent>) -> Ptr<QInputEvent>
Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QNativeGestureEvent* ptr)
.