Struct qt_gui::QTouchEvent
source · #[repr(C)]pub struct QTouchEvent { /* private fields */ }
Expand description
The QTouchEvent class contains parameters that describe a touch event.
C++ class: QTouchEvent
.
The QTouchEvent class contains parameters that describe a touch event.
Implementations§
source§impl QTouchEvent
impl QTouchEvent
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QTouchEvent>>
) -> Ref<QTouchEvent>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTouchEvent>> ) -> Ref<QTouchEvent>
The QTouchEvent class contains parameters that describe a touch event.
Calls C++ function: QTouchEvent& QTouchEvent::operator=(const QTouchEvent& other)
.
The QTouchEvent class contains parameters that describe a touch event.
sourcepub unsafe fn device(&self) -> Ptr<QTouchDevice>
pub unsafe fn device(&self) -> Ptr<QTouchDevice>
Returns the touch device from which this touch event originates.
Calls C++ function: QTouchDevice* QTouchEvent::device() const
.
Returns the touch device from which this touch event originates.
sourcepub unsafe fn new_5a(
event_type: Type,
device: impl CastInto<Ptr<QTouchDevice>>,
modifiers: QFlags<KeyboardModifier>,
touch_point_states: QFlags<TouchPointState>,
touch_points: impl CastInto<Ref<QListOfTouchPoint>>
) -> CppBox<QTouchEvent>
pub unsafe fn new_5a( event_type: Type, device: impl CastInto<Ptr<QTouchDevice>>, modifiers: QFlags<KeyboardModifier>, touch_point_states: QFlags<TouchPointState>, touch_points: impl CastInto<Ref<QListOfTouchPoint>> ) -> CppBox<QTouchEvent>
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
Calls C++ function: [constructor] void QTouchEvent::QTouchEvent(QEvent::Type eventType, QTouchDevice* device = …, QFlags<Qt::KeyboardModifier> modifiers = …, QFlags<Qt::TouchPointState> touchPointStates = …, const QList<QTouchEvent::TouchPoint>& touchPoints = …)
.
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
sourcepub unsafe fn new_4a(
event_type: Type,
device: impl CastInto<Ptr<QTouchDevice>>,
modifiers: QFlags<KeyboardModifier>,
touch_point_states: QFlags<TouchPointState>
) -> CppBox<QTouchEvent>
pub unsafe fn new_4a( event_type: Type, device: impl CastInto<Ptr<QTouchDevice>>, modifiers: QFlags<KeyboardModifier>, touch_point_states: QFlags<TouchPointState> ) -> CppBox<QTouchEvent>
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
Calls C++ function: [constructor] void QTouchEvent::QTouchEvent(QEvent::Type eventType, QTouchDevice* device = …, QFlags<Qt::KeyboardModifier> modifiers = …, QFlags<Qt::TouchPointState> touchPointStates = …)
.
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
sourcepub unsafe fn new_3a(
event_type: Type,
device: impl CastInto<Ptr<QTouchDevice>>,
modifiers: QFlags<KeyboardModifier>
) -> CppBox<QTouchEvent>
pub unsafe fn new_3a( event_type: Type, device: impl CastInto<Ptr<QTouchDevice>>, modifiers: QFlags<KeyboardModifier> ) -> CppBox<QTouchEvent>
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
Calls C++ function: [constructor] void QTouchEvent::QTouchEvent(QEvent::Type eventType, QTouchDevice* device = …, QFlags<Qt::KeyboardModifier> modifiers = …)
.
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
sourcepub unsafe fn new_2a(
event_type: Type,
device: impl CastInto<Ptr<QTouchDevice>>
) -> CppBox<QTouchEvent>
pub unsafe fn new_2a( event_type: Type, device: impl CastInto<Ptr<QTouchDevice>> ) -> CppBox<QTouchEvent>
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
Calls C++ function: [constructor] void QTouchEvent::QTouchEvent(QEvent::Type eventType, QTouchDevice* device = …)
.
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
sourcepub unsafe fn new_1a(event_type: Type) -> CppBox<QTouchEvent>
pub unsafe fn new_1a(event_type: Type) -> CppBox<QTouchEvent>
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
Calls C++ function: [constructor] void QTouchEvent::QTouchEvent(QEvent::Type eventType)
.
Constructs a QTouchEvent with the given eventType, device, and touchPoints. The touchPointStates and modifiers are the current touch point states and keyboard modifiers at the time of the event.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QTouchEvent>>
) -> CppBox<QTouchEvent>
pub unsafe fn new_copy( other: impl CastInto<Ref<QTouchEvent>> ) -> CppBox<QTouchEvent>
The QTouchEvent class contains parameters that describe a touch event.
Calls C++ function: [constructor] void QTouchEvent::QTouchEvent(const QTouchEvent& other)
.
The QTouchEvent class contains parameters that describe a touch event.
sourcepub unsafe fn set_device(&self, adevice: impl CastInto<Ptr<QTouchDevice>>)
pub unsafe fn set_device(&self, adevice: impl CastInto<Ptr<QTouchDevice>>)
Calls C++ function: void QTouchEvent::setDevice(QTouchDevice* adevice)
.
sourcepub unsafe fn set_target(&self, atarget: impl CastInto<Ptr<QObject>>)
pub unsafe fn set_target(&self, atarget: impl CastInto<Ptr<QObject>>)
Calls C++ function: void QTouchEvent::setTarget(QObject* atarget)
.
sourcepub unsafe fn set_touch_point_states(
&self,
a_touch_point_states: QFlags<TouchPointState>
)
pub unsafe fn set_touch_point_states( &self, a_touch_point_states: QFlags<TouchPointState> )
Calls C++ function: void QTouchEvent::setTouchPointStates(QFlags<Qt::TouchPointState> aTouchPointStates)
.
sourcepub unsafe fn set_touch_points(
&self,
atouch_points: impl CastInto<Ref<QListOfTouchPoint>>
)
pub unsafe fn set_touch_points( &self, atouch_points: impl CastInto<Ref<QListOfTouchPoint>> )
Calls C++ function: void QTouchEvent::setTouchPoints(const QList<QTouchEvent::TouchPoint>& atouchPoints)
.
sourcepub unsafe fn set_window(&self, awindow: impl CastInto<Ptr<QWindow>>)
pub unsafe fn set_window(&self, awindow: impl CastInto<Ptr<QWindow>>)
Calls C++ function: void QTouchEvent::setWindow(QWindow* awindow)
.
sourcepub unsafe fn target(&self) -> QPtr<QObject>
pub unsafe fn target(&self) -> QPtr<QObject>
Returns the target object within the window on which the event occurred. This is typically a QWidget or a QQuickItem. May be 0 when no specific target is available.
Calls C++ function: QObject* QTouchEvent::target() const
.
Returns the target object within the window on which the event occurred. This is typically a QWidget or a QQuickItem. May be 0 when no specific target is available.
sourcepub unsafe fn touch_point_states(&self) -> QFlags<TouchPointState>
pub unsafe fn touch_point_states(&self) -> QFlags<TouchPointState>
Returns a bitwise OR of all the touch point states for this event.
Calls C++ function: QFlags<Qt::TouchPointState> QTouchEvent::touchPointStates() const
.
Returns a bitwise OR of all the touch point states for this event.
sourcepub unsafe fn touch_points(&self) -> Ref<QListOfTouchPoint>
pub unsafe fn touch_points(&self) -> Ref<QListOfTouchPoint>
Returns the list of touch points contained in the touch event.
Calls C++ function: const QList<QTouchEvent::TouchPoint>& QTouchEvent::touchPoints() const
.
Returns the list of touch points contained in the touch event.
sourcepub unsafe fn window(&self) -> QPtr<QWindow>
pub unsafe fn window(&self) -> QPtr<QWindow>
Returns the window on which the event occurred. Useful for doing global-local mapping on data like rawScreenPositions() which, for performance reasons, only stores the global positions in the touch event.
Calls C++ function: QWindow* QTouchEvent::window() const
.
Returns the window on which the event occurred. Useful for doing global-local mapping on data like rawScreenPositions() which, for performance reasons, only stores the global positions in the touch event.
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 QTouchEvent
impl CppDeletable for QTouchEvent
source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys the QTouchEvent.
Calls C++ function: virtual [destructor] void QTouchEvent::~QTouchEvent()
.
Destroys the QTouchEvent.
source§impl Deref for QTouchEvent
impl Deref for QTouchEvent
source§fn deref(&self) -> &QInputEvent
fn deref(&self) -> &QInputEvent
Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QTouchEvent* ptr)
.
§type Target = QInputEvent
type Target = QInputEvent
source§impl DynamicCast<QTouchEvent> for QEvent
impl DynamicCast<QTouchEvent> for QEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QTouchEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QTouchEvent>
Calls C++ function: QTouchEvent* dynamic_cast<QTouchEvent*>(QEvent* ptr)
.
source§impl DynamicCast<QTouchEvent> for QInputEvent
impl DynamicCast<QTouchEvent> for QInputEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QTouchEvent>
unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QTouchEvent>
Calls C++ function: QTouchEvent* dynamic_cast<QTouchEvent*>(QInputEvent* ptr)
.
source§impl StaticDowncast<QTouchEvent> for QEvent
impl StaticDowncast<QTouchEvent> for QEvent
source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QTouchEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QTouchEvent>
Calls C++ function: QTouchEvent* static_cast<QTouchEvent*>(QEvent* ptr)
.
source§impl StaticDowncast<QTouchEvent> for QInputEvent
impl StaticDowncast<QTouchEvent> for QInputEvent
source§unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QTouchEvent>
unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QTouchEvent>
Calls C++ function: QTouchEvent* static_cast<QTouchEvent*>(QInputEvent* ptr)
.
source§impl StaticUpcast<QEvent> for QTouchEvent
impl StaticUpcast<QEvent> for QTouchEvent
source§unsafe fn static_upcast(ptr: Ptr<QTouchEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QTouchEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QTouchEvent* ptr)
.
source§impl StaticUpcast<QInputEvent> for QTouchEvent
impl StaticUpcast<QInputEvent> for QTouchEvent
source§unsafe fn static_upcast(ptr: Ptr<QTouchEvent>) -> Ptr<QInputEvent>
unsafe fn static_upcast(ptr: Ptr<QTouchEvent>) -> Ptr<QInputEvent>
Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QTouchEvent* ptr)
.