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
.
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
impl QTabletEvent
Returns the button that caused the event.
Calls C++ function: Qt::MouseButton QTabletEvent::button() const
.
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.
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
.
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.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QTabletEvent>>
) -> Ref<QTabletEvent>
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)
.
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.
sourcepub unsafe fn device(&self) -> TabletDevice
pub unsafe fn device(&self) -> TabletDevice
Returns the type of device that generated the event.
Calls C++ function: QTabletEvent::TabletDevice QTabletEvent::device() const
.
Returns the type of device that generated the event.
See also TabletDevice.
sourcepub unsafe fn global_pos(&self) -> CppBox<QPoint>
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
.
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().
sourcepub unsafe fn global_pos_f(&self) -> Ref<QPointF>
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
.
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().
sourcepub unsafe fn global_x(&self) -> c_int
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
.
Returns the global x position of the mouse pointer at the time of the event.
See also globalY(), globalPos(), and hiResGlobalX().
sourcepub unsafe fn global_y(&self) -> c_int
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
.
Returns the global y position of the tablet device at the time of the event.
See also globalX(), globalPos(), and hiResGlobalY().
sourcepub unsafe fn hi_res_global_x(&self) -> c_double
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
.
The high precision x position of the tablet device.
sourcepub unsafe fn hi_res_global_y(&self) -> c_double
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
.
The high precision y position of the tablet device.
sourcepub 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>
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().
sourcepub 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>
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)
.
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().
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QTabletEvent>>
) -> CppBox<QTabletEvent>
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)
.
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.
sourcepub unsafe fn pointer_type(&self) -> PointerType
pub unsafe fn pointer_type(&self) -> PointerType
Returns the type of point that generated the event.
Calls C++ function: QTabletEvent::PointerType QTabletEvent::pointerType() const
.
Returns the type of point that generated the event.
sourcepub unsafe fn pos(&self) -> CppBox<QPoint>
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
.
sourcepub unsafe fn pos_f(&self) -> Ref<QPointF>
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
.
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().
sourcepub unsafe fn pressure(&self) -> c_double
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
.
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().
sourcepub unsafe fn rotation(&self) -> c_double
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
.
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.
sourcepub unsafe fn static_meta_object() -> Ref<QMetaObject>
pub unsafe fn static_meta_object() -> Ref<QMetaObject>
Returns a reference to the staticMetaObject
field.
sourcepub unsafe fn tangential_pressure(&self) -> c_double
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
.
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().
sourcepub unsafe fn unique_id(&self) -> i64
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
.
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().
sourcepub unsafe fn x(&self) -> c_int
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
.
sourcepub unsafe fn x_tilt(&self) -> c_int
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
.
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().
sourcepub unsafe fn y(&self) -> c_int
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
.
sourcepub unsafe fn y_tilt(&self) -> c_int
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
.
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().
sourcepub unsafe fn z(&self) -> c_int
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
.
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>§
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 QTabletEvent
impl CppDeletable for QTabletEvent
source§impl Deref for QTabletEvent
impl Deref for QTabletEvent
source§fn deref(&self) -> &QInputEvent
fn deref(&self) -> &QInputEvent
Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QTabletEvent* ptr)
.
§type Target = QInputEvent
type Target = QInputEvent
source§impl DynamicCast<QTabletEvent> for QEvent
impl DynamicCast<QTabletEvent> for QEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QTabletEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QTabletEvent>
Calls C++ function: QTabletEvent* dynamic_cast<QTabletEvent*>(QEvent* ptr)
.
source§impl DynamicCast<QTabletEvent> for QInputEvent
impl DynamicCast<QTabletEvent> for QInputEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QTabletEvent>
unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QTabletEvent>
Calls C++ function: QTabletEvent* dynamic_cast<QTabletEvent*>(QInputEvent* ptr)
.
source§impl StaticDowncast<QTabletEvent> for QEvent
impl StaticDowncast<QTabletEvent> for QEvent
source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QTabletEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QTabletEvent>
Calls C++ function: QTabletEvent* static_cast<QTabletEvent*>(QEvent* ptr)
.
source§impl StaticDowncast<QTabletEvent> for QInputEvent
impl StaticDowncast<QTabletEvent> for QInputEvent
source§unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QTabletEvent>
unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QTabletEvent>
Calls C++ function: QTabletEvent* static_cast<QTabletEvent*>(QInputEvent* ptr)
.
source§impl StaticUpcast<QEvent> for QTabletEvent
impl StaticUpcast<QEvent> for QTabletEvent
source§unsafe fn static_upcast(ptr: Ptr<QTabletEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QTabletEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QTabletEvent* ptr)
.
source§impl StaticUpcast<QInputEvent> for QTabletEvent
impl StaticUpcast<QInputEvent> for QTabletEvent
source§unsafe fn static_upcast(ptr: Ptr<QTabletEvent>) -> Ptr<QInputEvent>
unsafe fn static_upcast(ptr: Ptr<QTabletEvent>) -> Ptr<QInputEvent>
Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QTabletEvent* ptr)
.