Struct qt_gui::QTabletEvent

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

The QTabletEvent class contains parameters that describe a Tablet event.

C++ class: QTabletEvent.

C++ documentation:

The QTabletEvent class contains parameters that describe a Tablet event.

Tablet events are generated from tablet peripherals such as Wacom tablets and various other brands, and electromagnetic stylus devices included with some types of tablet computers. (It is not the same as QTouchEvent which a touchscreen generates, even when a passive stylus is used on a touchscreen.)

Tablet events are similar to mouse events; for example, the x(), y(), pos(), globalX(), globalY(), and globalPos() accessors provide the cursor position, and you can see which buttons() are pressed (pressing the stylus tip against the tablet surface is equivalent to a left mouse button). But tablet events also pass through some extra information that the tablet device driver provides; for example, you might want to do subpixel rendering with higher resolution coordinates (hiResGlobalX() and hiResGlobalY()), adjust color brightness based on the pressure() of the tool against the tablet surface, use different brushes depending on the type of tool in use (device()), modulate the brush shape in some way according to the X-axis and Y-axis tilt of the tool with respect to the tablet surface (xTilt() and yTilt()), and use a virtual eraser instead of a brush if the user switches to the other end of a double-ended stylus (pointerType()).

Every event contains an accept flag that indicates whether the receiver wants the event. You should call QTabletEvent::accept() if you handle the tablet event; otherwise it will be sent to the parent widget. The exception are TabletEnterProximity and TabletLeaveProximity events: these are only sent to QApplication and do not check whether or not they are accepted.

The QWidget::setEnabled() function can be used to enable or disable mouse, tablet and keyboard events for a widget.

The event handler QWidget::tabletEvent() receives TabletPress, TabletRelease and TabletMove events. Qt will first send a tablet event, then if it is not accepted by any widget, it will send a mouse event. This allows users of applications that are not designed for tablets to use a tablet like a mouse. However high-resolution drawing applications should handle the tablet events, because they can occur at a higher frequency, which is a benefit for smooth and accurate drawing. If the tablet events are rejected, the synthetic mouse events may be compressed for efficiency.

New in Qt 5.4: QTabletEvent includes all information available from the device, including QTabletEvent::buttons(). Previously it was not possible to accept all tablet events and also know which stylus buttons were pressed.

Note that pressing the stylus button while the stylus hovers over the tablet will generate a button press on some types of tablets, while on other types it will be necessary to press the stylus against the tablet surface in order to register the simultaneous stylus button press.

Implementations§

source§

impl QTabletEvent

source

pub unsafe fn button(&self) -> MouseButton

Returns the button that caused the event.

Calls C++ function: Qt::MouseButton QTabletEvent::button() const.

C++ documentation:

Returns the button that caused the event.

Note that the returned value is always Qt::NoButton for TabletMove, TabletEnterProximity and TabletLeaveProximity events.

See also buttons() and Qt::MouseButton.

source

pub unsafe fn buttons(&self) -> QFlags<MouseButton>

Returns the button state when the event was generated. The button state is a combination of buttons from the Qt::MouseButton enum using the OR operator. For TabletMove events, this is all buttons that are pressed down. For TabletPress events this includes the button that caused the event. For TabletRelease events this excludes the button that caused the event.

Calls C++ function: QFlags<Qt::MouseButton> QTabletEvent::buttons() const.

C++ documentation:

Returns the button state when the event was generated. The button state is a combination of buttons from the Qt::MouseButton enum using the OR operator. For TabletMove events, this is all buttons that are pressed down. For TabletPress events this includes the button that caused the event. For TabletRelease events this excludes the button that caused the event.

See also button() and Qt::MouseButton.

source

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

The QTabletEvent class contains parameters that describe a Tablet event.

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

C++ documentation:

The QTabletEvent class contains parameters that describe a Tablet event.

Tablet events are generated from tablet peripherals such as Wacom tablets and various other brands, and electromagnetic stylus devices included with some types of tablet computers. (It is not the same as QTouchEvent which a touchscreen generates, even when a passive stylus is used on a touchscreen.)

Tablet events are similar to mouse events; for example, the x(), y(), pos(), globalX(), globalY(), and globalPos() accessors provide the cursor position, and you can see which buttons() are pressed (pressing the stylus tip against the tablet surface is equivalent to a left mouse button). But tablet events also pass through some extra information that the tablet device driver provides; for example, you might want to do subpixel rendering with higher resolution coordinates (hiResGlobalX() and hiResGlobalY()), adjust color brightness based on the pressure() of the tool against the tablet surface, use different brushes depending on the type of tool in use (device()), modulate the brush shape in some way according to the X-axis and Y-axis tilt of the tool with respect to the tablet surface (xTilt() and yTilt()), and use a virtual eraser instead of a brush if the user switches to the other end of a double-ended stylus (pointerType()).

Every event contains an accept flag that indicates whether the receiver wants the event. You should call QTabletEvent::accept() if you handle the tablet event; otherwise it will be sent to the parent widget. The exception are TabletEnterProximity and TabletLeaveProximity events: these are only sent to QApplication and do not check whether or not they are accepted.

The QWidget::setEnabled() function can be used to enable or disable mouse, tablet and keyboard events for a widget.

The event handler QWidget::tabletEvent() receives TabletPress, TabletRelease and TabletMove events. Qt will first send a tablet event, then if it is not accepted by any widget, it will send a mouse event. This allows users of applications that are not designed for tablets to use a tablet like a mouse. However high-resolution drawing applications should handle the tablet events, because they can occur at a higher frequency, which is a benefit for smooth and accurate drawing. If the tablet events are rejected, the synthetic mouse events may be compressed for efficiency.

New in Qt 5.4: QTabletEvent includes all information available from the device, including QTabletEvent::buttons(). Previously it was not possible to accept all tablet events and also know which stylus buttons were pressed.

Note that pressing the stylus button while the stylus hovers over the tablet will generate a button press on some types of tablets, while on other types it will be necessary to press the stylus against the tablet surface in order to register the simultaneous stylus button press.

source

pub unsafe fn device(&self) -> TabletDevice

Returns the type of device that generated the event.

Calls C++ function: QTabletEvent::TabletDevice QTabletEvent::device() const.

C++ documentation:

Returns the type of device that generated the event.

See also TabletDevice.

source

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

Returns the global position of the device at the time of the event. This is important on asynchronous windows systems like X11; whenever you move your widgets around in response to mouse events, globalPos() can differ significantly from the current position QCursor::pos().

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

C++ documentation:

Returns the global position of the device at the time of the event. This is important on asynchronous windows systems like X11; whenever you move your widgets around in response to mouse events, globalPos() can differ significantly from the current position QCursor::pos().

See also globalX(), globalY(), and hiResGlobalPos().

source

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

Returns the global position of the device at the time of the event. This is important on asynchronous windows systems like X11; whenever you move your widgets around in response to mouse events, globalPosF() can differ significantly from the current position QCursor::pos().

Calls C++ function: const QPointF& QTabletEvent::globalPosF() const.

C++ documentation:

Returns the global position of the device at the time of the event. This is important on asynchronous windows systems like X11; whenever you move your widgets around in response to mouse events, globalPosF() can differ significantly from the current position QCursor::pos().

See also posF().

source

pub unsafe fn global_x(&self) -> c_int

Returns the global x position of the mouse pointer at the time of the event.

Calls C++ function: int QTabletEvent::globalX() const.

C++ documentation:

Returns the global x position of the mouse pointer at the time of the event.

See also globalY(), globalPos(), and hiResGlobalX().

source

pub unsafe fn global_y(&self) -> c_int

Returns the global y position of the tablet device at the time of the event.

Calls C++ function: int QTabletEvent::globalY() const.

C++ documentation:

Returns the global y position of the tablet device at the time of the event.

See also globalX(), globalPos(), and hiResGlobalY().

source

pub unsafe fn hi_res_global_x(&self) -> c_double

The high precision x position of the tablet device.

Calls C++ function: double QTabletEvent::hiResGlobalX() const.

C++ documentation:

The high precision x position of the tablet device.

source

pub unsafe fn hi_res_global_y(&self) -> c_double

The high precision y position of the tablet device.

Calls C++ function: double QTabletEvent::hiResGlobalY() const.

C++ documentation:

The high precision y position of the tablet device.

source

pub unsafe fn new_13a( t: Type, pos: impl CastInto<Ref<QPointF>>, global_pos: impl CastInto<Ref<QPointF>>, device: c_int, pointer_type: c_int, pressure: c_double, x_tilt: c_int, y_tilt: c_int, tangential_pressure: c_double, rotation: c_double, z: c_int, key_state: QFlags<KeyboardModifier>, unique_i_d: i64 ) -> CppBox<QTabletEvent>

Construct a tablet event of the given type.

Calls C++ function: [constructor] void QTabletEvent::QTabletEvent(QEvent::Type t, const QPointF& pos, const QPointF& globalPos, int device, int pointerType, double pressure, int xTilt, int yTilt, double tangentialPressure, double rotation, int z, QFlags<Qt::KeyboardModifier> keyState, qint64 uniqueID).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for QTabletEvent::QTabletEvent(Type type, const QPointF &pos, const QPointF &globalPos, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers keyState, qint64 uniqueID, Qt::MouseButton button, Qt::MouseButtons buttons):

Construct a tablet event of the given type.

The pos parameter indicates where the event occurred in the widget; globalPos is the corresponding position in absolute coordinates.

pressure contains the pressure exerted on the device.

pointerType describes the type of pen that is being used.

xTilt and yTilt contain the device's degree of tilt from the x and y axes respectively.

keyState specifies which keyboard modifiers are pressed (e.g., Ctrl).

The uniqueID parameter contains the unique ID for the current device.

The z parameter contains the coordinate of the device on the tablet, this is usually given by a wheel on 4D mouse. If the device does not support a Z-axis, pass zero here.

The tangentialPressure parameter contins the tangential pressure of an air brush. If the device does not support tangential pressure, pass 0 here.

rotation contains the device's rotation in degrees. 4D mice and the Wacom Art Pen support rotation. If the device does not support rotation, pass 0 here.

The button that caused the event is given as a value from the Qt::MouseButton enum. If the event type is not TabletPress or TabletRelease, the appropriate button for this event is Qt::NoButton.

buttons is the state of all buttons at the time of the event.

See also pos(), globalPos(), device(), pressure(), xTilt(), yTilt(), uniqueId(), rotation(), tangentialPressure(), and z().

source

pub unsafe fn new_15a( t: Type, pos: impl CastInto<Ref<QPointF>>, global_pos: impl CastInto<Ref<QPointF>>, device: c_int, pointer_type: c_int, pressure: c_double, x_tilt: c_int, y_tilt: c_int, tangential_pressure: c_double, rotation: c_double, z: c_int, key_state: QFlags<KeyboardModifier>, unique_i_d: i64, button: MouseButton, buttons: QFlags<MouseButton> ) -> CppBox<QTabletEvent>

Construct a tablet event of the given type.

Calls C++ function: [constructor] void QTabletEvent::QTabletEvent(QEvent::Type t, const QPointF& pos, const QPointF& globalPos, int device, int pointerType, double pressure, int xTilt, int yTilt, double tangentialPressure, double rotation, int z, QFlags<Qt::KeyboardModifier> keyState, qint64 uniqueID, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons).

C++ documentation:

Construct a tablet event of the given type.

The pos parameter indicates where the event occurred in the widget; globalPos is the corresponding position in absolute coordinates.

pressure contains the pressure exerted on the device.

pointerType describes the type of pen that is being used.

xTilt and yTilt contain the device's degree of tilt from the x and y axes respectively.

keyState specifies which keyboard modifiers are pressed (e.g., Ctrl).

The uniqueID parameter contains the unique ID for the current device.

The z parameter contains the coordinate of the device on the tablet, this is usually given by a wheel on 4D mouse. If the device does not support a Z-axis, pass zero here.

The tangentialPressure parameter contins the tangential pressure of an air brush. If the device does not support tangential pressure, pass 0 here.

rotation contains the device's rotation in degrees. 4D mice and the Wacom Art Pen support rotation. If the device does not support rotation, pass 0 here.

The button that caused the event is given as a value from the Qt::MouseButton enum. If the event type is not TabletPress or TabletRelease, the appropriate button for this event is Qt::NoButton.

buttons is the state of all buttons at the time of the event.

See also pos(), globalPos(), device(), pressure(), xTilt(), yTilt(), uniqueId(), rotation(), tangentialPressure(), and z().

source

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

The QTabletEvent class contains parameters that describe a Tablet event.

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

C++ documentation:

The QTabletEvent class contains parameters that describe a Tablet event.

Tablet events are generated from tablet peripherals such as Wacom tablets and various other brands, and electromagnetic stylus devices included with some types of tablet computers. (It is not the same as QTouchEvent which a touchscreen generates, even when a passive stylus is used on a touchscreen.)

Tablet events are similar to mouse events; for example, the x(), y(), pos(), globalX(), globalY(), and globalPos() accessors provide the cursor position, and you can see which buttons() are pressed (pressing the stylus tip against the tablet surface is equivalent to a left mouse button). But tablet events also pass through some extra information that the tablet device driver provides; for example, you might want to do subpixel rendering with higher resolution coordinates (hiResGlobalX() and hiResGlobalY()), adjust color brightness based on the pressure() of the tool against the tablet surface, use different brushes depending on the type of tool in use (device()), modulate the brush shape in some way according to the X-axis and Y-axis tilt of the tool with respect to the tablet surface (xTilt() and yTilt()), and use a virtual eraser instead of a brush if the user switches to the other end of a double-ended stylus (pointerType()).

Every event contains an accept flag that indicates whether the receiver wants the event. You should call QTabletEvent::accept() if you handle the tablet event; otherwise it will be sent to the parent widget. The exception are TabletEnterProximity and TabletLeaveProximity events: these are only sent to QApplication and do not check whether or not they are accepted.

The QWidget::setEnabled() function can be used to enable or disable mouse, tablet and keyboard events for a widget.

The event handler QWidget::tabletEvent() receives TabletPress, TabletRelease and TabletMove events. Qt will first send a tablet event, then if it is not accepted by any widget, it will send a mouse event. This allows users of applications that are not designed for tablets to use a tablet like a mouse. However high-resolution drawing applications should handle the tablet events, because they can occur at a higher frequency, which is a benefit for smooth and accurate drawing. If the tablet events are rejected, the synthetic mouse events may be compressed for efficiency.

New in Qt 5.4: QTabletEvent includes all information available from the device, including QTabletEvent::buttons(). Previously it was not possible to accept all tablet events and also know which stylus buttons were pressed.

Note that pressing the stylus button while the stylus hovers over the tablet will generate a button press on some types of tablets, while on other types it will be necessary to press the stylus against the tablet surface in order to register the simultaneous stylus button press.

source

pub unsafe fn pointer_type(&self) -> PointerType

Returns the type of point that generated the event.

Calls C++ function: QTabletEvent::PointerType QTabletEvent::pointerType() const.

C++ documentation:

Returns the type of point that generated the event.

source

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

Returns the position of the device, relative to the widget that received the event.

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

C++ documentation:

Returns the position of the device, relative to the widget that received the event.

If you move widgets around in response to mouse events, use globalPos() instead of this function.

See also x(), y(), and globalPos().

source

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

Returns the position of the device, relative to the widget that received the event.

Calls C++ function: const QPointF& QTabletEvent::posF() const.

C++ documentation:

Returns the position of the device, relative to the widget that received the event.

If you move widgets around in response to mouse events, use globalPosF() instead of this function.

See also globalPosF().

source

pub unsafe fn pressure(&self) -> c_double

Returns the pressure for the device. 0.0 indicates that the stylus is not on the tablet, 1.0 indicates the maximum amount of pressure for the stylus.

Calls C++ function: double QTabletEvent::pressure() const.

C++ documentation:

Returns the pressure for the device. 0.0 indicates that the stylus is not on the tablet, 1.0 indicates the maximum amount of pressure for the stylus.

See also tangentialPressure().

source

pub unsafe fn rotation(&self) -> c_double

Returns the rotation of the current device in degress. This is usually given by a 4D Mouse. If the device does not support rotation this value is always 0.0.

Calls C++ function: double QTabletEvent::rotation() const.

C++ documentation:

Returns the rotation of the current device in degress. This is usually given by a 4D Mouse. If the device does not support rotation this value is always 0.0.

source

pub unsafe fn static_meta_object() -> Ref<QMetaObject>

Returns a reference to the staticMetaObject field.

source

pub unsafe fn tangential_pressure(&self) -> c_double

Returns the tangential pressure for the device. This is typically given by a finger wheel on an airbrush tool. The range is from -1.0 to 1.0. 0.0 indicates a neutral position. Current airbrushes can only move in the positive direction from the neutrual position. If the device does not support tangential pressure, this value is always 0.0.

Calls C++ function: double QTabletEvent::tangentialPressure() const.

C++ documentation:

Returns the tangential pressure for the device. This is typically given by a finger wheel on an airbrush tool. The range is from -1.0 to 1.0. 0.0 indicates a neutral position. Current airbrushes can only move in the positive direction from the neutrual position. If the device does not support tangential pressure, this value is always 0.0.

See also pressure().

source

pub unsafe fn unique_id(&self) -> i64

Returns a unique ID for the current device, making it possible to differentiate between multiple devices being used at the same time on the tablet.

Calls C++ function: qint64 QTabletEvent::uniqueId() const.

C++ documentation:

Returns a unique ID for the current device, making it possible to differentiate between multiple devices being used at the same time on the tablet.

Support of this feature is dependent on the tablet.

Values for the same device may vary from OS to OS.

Later versions of the Wacom driver for Linux will now report the ID information. If you have a tablet that supports unique ID and are not getting the information on Linux, consider upgrading your driver.

As of Qt 4.2, the unique ID is the same regardless of the orientation of the pen. Earlier versions would report a different value when using the eraser-end versus the pen-end of the stylus on some OS's.

See also pointerType().

source

pub unsafe fn x(&self) -> c_int

Returns the x position of the device, relative to the widget that received the event.

Calls C++ function: int QTabletEvent::x() const.

C++ documentation:

Returns the x position of the device, relative to the widget that received the event.

See also y() and pos().

source

pub unsafe fn x_tilt(&self) -> c_int

Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. Positive values are towards the tablet's physical right. The angle is in the range -60 to +60 degrees.

Calls C++ function: int QTabletEvent::xTilt() const.

C++ documentation:

Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. Positive values are towards the tablet’s physical right. The angle is in the range -60 to +60 degrees.

See also yTilt().

source

pub unsafe fn y(&self) -> c_int

Returns the y position of the device, relative to the widget that received the event.

Calls C++ function: int QTabletEvent::y() const.

C++ documentation:

Returns the y position of the device, relative to the widget that received the event.

See also x() and pos().

source

pub unsafe fn y_tilt(&self) -> c_int

Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the y axis. Positive values are towards the bottom of the tablet. The angle is within the range -60 to +60 degrees.

Calls C++ function: int QTabletEvent::yTilt() const.

C++ documentation:

Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the y axis. Positive values are towards the bottom of the tablet. The angle is within the range -60 to +60 degrees.

See also xTilt().

source

pub unsafe fn z(&self) -> c_int

Returns the z position of the device. Typically this is represented by a wheel on a 4D Mouse. If the device does not support a Z-axis, this value is always zero. This is not the same as pressure.

Calls C++ function: int QTabletEvent::z() const.

C++ documentation:

Returns the z position of the device. Typically this is represented by a wheel on a 4D Mouse. If the device does not support a Z-axis, this value is always zero. This is not the same as pressure.

See also pressure().

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 QTabletEvent

source§

unsafe fn delete(&self)

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

source§

impl Deref for QTabletEvent

source§

fn deref(&self) -> &QInputEvent

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

§

type Target = QInputEvent

The resulting type after dereferencing.
source§

impl DynamicCast<QTabletEvent> for QEvent

source§

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

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

source§

impl DynamicCast<QTabletEvent> for QInputEvent

source§

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

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

source§

impl StaticDowncast<QTabletEvent> for QEvent

source§

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

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

source§

impl StaticDowncast<QTabletEvent> for QInputEvent

source§

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

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

source§

impl StaticUpcast<QEvent> for QTabletEvent

source§

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

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

source§

impl StaticUpcast<QInputEvent> for QTabletEvent

source§

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

Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QTabletEvent* 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.