Struct qt_gui::q_touch_event::TouchPoint
source · #[repr(C)]pub struct TouchPoint { /* private fields */ }
Expand description
The TouchPoint class provides information about a touch point in a QTouchEvent.
C++ class: QTouchEvent::TouchPoint
.
The TouchPoint class provides information about a touch point in a QTouchEvent.
Implementations§
source§impl TouchPoint
impl TouchPoint
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<TouchPoint>>
) -> Ref<TouchPoint>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<TouchPoint>> ) -> Ref<TouchPoint>
Calls C++ function: QTouchEvent::TouchPoint& QTouchEvent::TouchPoint::operator=(const QTouchEvent::TouchPoint& other)
.
sourcepub unsafe fn ellipse_diameters(&self) -> CppBox<QSizeF>
pub unsafe fn ellipse_diameters(&self) -> CppBox<QSizeF>
Returns the width and height of the bounding ellipse of this touch point. The return value is in logical pixels. Most touchscreens do not detect the shape of the contact point, so a null size is the most common value. In other cases the diameters may be nonzero and equal (the ellipse is approximated as a circle).
Calls C++ function: QSizeF QTouchEvent::TouchPoint::ellipseDiameters() const
.
Returns the width and height of the bounding ellipse of this touch point. The return value is in logical pixels. Most touchscreens do not detect the shape of the contact point, so a null size is the most common value. In other cases the diameters may be nonzero and equal (the ellipse is approximated as a circle).
This function was introduced in Qt 5.9.
sourcepub unsafe fn flags(&self) -> QFlags<InfoFlag>
pub unsafe fn flags(&self) -> QFlags<InfoFlag>
Returns additional information about the touch point.
Calls C++ function: QFlags<QTouchEvent::TouchPoint::InfoFlag> QTouchEvent::TouchPoint::flags() const
.
Returns additional information about the touch point.
See also QTouchEvent::TouchPoint::InfoFlags.
sourcepub unsafe fn id(&self) -> c_int
pub unsafe fn id(&self) -> c_int
Returns the id number of this touch point.
Calls C++ function: int QTouchEvent::TouchPoint::id() const
.
Returns the id number of this touch point.
Do not assume that id numbers start at zero or that they are sequential. Such an assumption is often false due to the way the underlying drivers work.
sourcepub unsafe fn last_normalized_pos(&self) -> CppBox<QPointF>
pub unsafe fn last_normalized_pos(&self) -> CppBox<QPointF>
Returns the normalized position of this touch point from the previous touch event.
Calls C++ function: QPointF QTouchEvent::TouchPoint::lastNormalizedPos() const
.
Returns the normalized position of this touch point from the previous touch event.
The coordinates are normalized to the size of the touch device, i.e. (0,0) is the top-left corner and (1,1) is the bottom-right corner.
See also normalizedPos() and startNormalizedPos().
sourcepub unsafe fn last_pos(&self) -> CppBox<QPointF>
pub unsafe fn last_pos(&self) -> CppBox<QPointF>
Returns the position of this touch point from the previous touch event, relative to the widget or QGraphicsItem that received the event.
Calls C++ function: QPointF QTouchEvent::TouchPoint::lastPos() const
.
Returns the position of this touch point from the previous touch event, relative to the widget or QGraphicsItem that received the event.
sourcepub unsafe fn last_scene_pos(&self) -> CppBox<QPointF>
pub unsafe fn last_scene_pos(&self) -> CppBox<QPointF>
Returns the scene position of this touch point from the previous touch event.
Calls C++ function: QPointF QTouchEvent::TouchPoint::lastScenePos() const
.
Returns the scene position of this touch point from the previous touch event.
The scene position is the position in QGraphicsScene coordinates if the QTouchEvent is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.
See also scenePos() and startScenePos().
sourcepub unsafe fn last_screen_pos(&self) -> CppBox<QPointF>
pub unsafe fn last_screen_pos(&self) -> CppBox<QPointF>
Returns the screen position of this touch point from the previous touch event.
Calls C++ function: QPointF QTouchEvent::TouchPoint::lastScreenPos() const
.
Returns the screen position of this touch point from the previous touch event.
See also screenPos() and startScreenPos().
sourcepub unsafe fn new_1a(id: c_int) -> CppBox<TouchPoint>
pub unsafe fn new_1a(id: c_int) -> CppBox<TouchPoint>
Move-constructs a TouchPoint instance, making it point to the same object that other was pointing to.
Calls C++ function: [constructor] void QTouchEvent::TouchPoint::TouchPoint(int id = …)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for TouchPoint::TouchPoint(TouchPoint &&other)
:
Move-constructs a TouchPoint instance, making it point to the same object that other was pointing to.
sourcepub unsafe fn new_0a() -> CppBox<TouchPoint>
pub unsafe fn new_0a() -> CppBox<TouchPoint>
The TouchPoint class provides information about a touch point in a QTouchEvent.
Calls C++ function: [constructor] void QTouchEvent::TouchPoint::TouchPoint()
.
The TouchPoint class provides information about a touch point in a QTouchEvent.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<TouchPoint>>
) -> CppBox<TouchPoint>
pub unsafe fn new_copy( other: impl CastInto<Ref<TouchPoint>> ) -> CppBox<TouchPoint>
Move-constructs a TouchPoint instance, making it point to the same object that other was pointing to.
Calls C++ function: [constructor] void QTouchEvent::TouchPoint::TouchPoint(const QTouchEvent::TouchPoint& other)
.
Warning: no exact match found in C++ documentation. Below is the C++ documentation for TouchPoint::TouchPoint(TouchPoint &&other)
:
Move-constructs a TouchPoint instance, making it point to the same object that other was pointing to.
sourcepub unsafe fn normalized_pos(&self) -> CppBox<QPointF>
pub unsafe fn normalized_pos(&self) -> CppBox<QPointF>
Returns the normalized position of this touch point.
Calls C++ function: QPointF QTouchEvent::TouchPoint::normalizedPos() const
.
Returns the normalized position of this touch point.
The coordinates are normalized to the size of the touch device, i.e. (0,0) is the top-left corner and (1,1) is the bottom-right corner.
See also startNormalizedPos(), lastNormalizedPos(), and pos().
sourcepub unsafe fn pos(&self) -> CppBox<QPointF>
pub unsafe fn pos(&self) -> CppBox<QPointF>
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the event.
Calls C++ function: QPointF QTouchEvent::TouchPoint::pos() const
.
Returns the position of this touch point, relative to the widget or QGraphicsItem that received the event.
See also startPos(), lastPos(), screenPos(), scenePos(), and normalizedPos().
sourcepub unsafe fn pressure(&self) -> c_double
pub unsafe fn pressure(&self) -> c_double
Returns the pressure of this touch point. The return value is in the range 0.0 to 1.0.
Calls C++ function: double QTouchEvent::TouchPoint::pressure() const
.
Returns the pressure of this touch point. The return value is in the range 0.0 to 1.0.
sourcepub unsafe fn raw_screen_positions(&self) -> CppBox<QVectorOfQPointF>
pub unsafe fn raw_screen_positions(&self) -> CppBox<QVectorOfQPointF>
Returns the raw, unfiltered positions for the touch point. The positions are in native screen coordinates. To get local coordinates you can use mapFromGlobal() of the QWindow returned by QTouchEvent::window().
Calls C++ function: QVector<QPointF> QTouchEvent::TouchPoint::rawScreenPositions() const
.
Returns the raw, unfiltered positions for the touch point. The positions are in native screen coordinates. To get local coordinates you can use mapFromGlobal() of the QWindow returned by QTouchEvent::window().
Note: Returns an empty vector if the touch device's capabilities do not include QTouchDevice::RawPositions.
Note: Native screen coordinates refer to the native orientation of the screen which, in case of mobile devices, is typically portrait. This means that on systems capable of screen orientation changes the positions in this list will not reflect the current orientation (unlike pos(), screenPos(), etc.) and will always be reported in the native orientation.
This function was introduced in Qt 5.0.
See also QTouchDevice::capabilities(), device(), and window().
sourcepub unsafe fn rect(&self) -> CppBox<QRectF>
pub unsafe fn rect(&self) -> CppBox<QRectF>
Returns the rect for this touch point, relative to the widget or QGraphicsItem that received the event. The rect is centered around the point returned by pos().
Calls C++ function: QRectF QTouchEvent::TouchPoint::rect() const
.
Returns the rect for this touch point, relative to the widget or QGraphicsItem that received the event. The rect is centered around the point returned by pos().
Note: This function returns an empty rect if the device does not report touch point sizes.
of the touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position pos() with ellipseDiameters() which are independent of rotation().
See also scenePos() and ellipseDiameters().
sourcepub unsafe fn rotation(&self) -> c_double
pub unsafe fn rotation(&self) -> c_double
Returns the angular orientation of this touch point. The return value is in degrees, where zero (the default) indicates the finger or token is pointing upwards, a negative angle means it's rotated to the left, and a positive angle means it's rotated to the right. Most touchscreens do not detect rotation, so zero is the most common value.
Calls C++ function: double QTouchEvent::TouchPoint::rotation() const
.
Returns the angular orientation of this touch point. The return value is in degrees, where zero (the default) indicates the finger or token is pointing upwards, a negative angle means it’s rotated to the left, and a positive angle means it’s rotated to the right. Most touchscreens do not detect rotation, so zero is the most common value.
This function was introduced in Qt 5.8.
sourcepub unsafe fn scene_pos(&self) -> CppBox<QPointF>
pub unsafe fn scene_pos(&self) -> CppBox<QPointF>
Returns the scene position of this touch point.
Calls C++ function: QPointF QTouchEvent::TouchPoint::scenePos() const
.
Returns the scene position of this touch point.
The scene position is the position in QGraphicsScene coordinates if the QTouchEvent is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.
See also startScenePos(), lastScenePos(), and pos().
sourcepub unsafe fn scene_rect(&self) -> CppBox<QRectF>
pub unsafe fn scene_rect(&self) -> CppBox<QRectF>
Returns the rect for this touch point in scene coordinates.
Calls C++ function: QRectF QTouchEvent::TouchPoint::sceneRect() const
.
Returns the rect for this touch point in scene coordinates.
Note: This function returns an empty rect if the device does not report touch point sizes.
of the touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position scenePos() with ellipseDiameters() which are independent of rotation().
See also scenePos() and ellipseDiameters().
sourcepub unsafe fn screen_pos(&self) -> CppBox<QPointF>
pub unsafe fn screen_pos(&self) -> CppBox<QPointF>
Returns the screen position of this touch point.
Calls C++ function: QPointF QTouchEvent::TouchPoint::screenPos() const
.
Returns the screen position of this touch point.
See also startScreenPos(), lastScreenPos(), and pos().
sourcepub unsafe fn screen_rect(&self) -> CppBox<QRectF>
pub unsafe fn screen_rect(&self) -> CppBox<QRectF>
Returns the rect for this touch point in screen coordinates.
Calls C++ function: QRectF QTouchEvent::TouchPoint::screenRect() const
.
Returns the rect for this touch point in screen coordinates.
Note: This function returns an empty rect if the device does not report touch point sizes.
touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position screenPos() with ellipseDiameters() which are independent of rotation().
See also screenPos() and ellipseDiameters().
sourcepub unsafe fn set_ellipse_diameters(&self, dia: impl CastInto<Ref<QSizeF>>)
pub unsafe fn set_ellipse_diameters(&self, dia: impl CastInto<Ref<QSizeF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setEllipseDiameters(const QSizeF& dia)
.
sourcepub unsafe fn set_flags(&self, flags: QFlags<InfoFlag>)
pub unsafe fn set_flags(&self, flags: QFlags<InfoFlag>)
Calls C++ function: void QTouchEvent::TouchPoint::setFlags(QFlags<QTouchEvent::TouchPoint::InfoFlag> flags)
.
sourcepub unsafe fn set_id(&self, id: c_int)
pub unsafe fn set_id(&self, id: c_int)
Calls C++ function: void QTouchEvent::TouchPoint::setId(int id)
.
sourcepub unsafe fn set_last_normalized_pos(
&self,
last_normalized_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_last_normalized_pos( &self, last_normalized_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setLastNormalizedPos(const QPointF& lastNormalizedPos)
.
sourcepub unsafe fn set_last_pos(&self, last_pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_last_pos(&self, last_pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setLastPos(const QPointF& lastPos)
.
sourcepub unsafe fn set_last_scene_pos(
&self,
last_scene_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_last_scene_pos( &self, last_scene_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setLastScenePos(const QPointF& lastScenePos)
.
sourcepub unsafe fn set_last_screen_pos(
&self,
last_screen_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_last_screen_pos( &self, last_screen_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setLastScreenPos(const QPointF& lastScreenPos)
.
sourcepub unsafe fn set_normalized_pos(
&self,
normalized_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_normalized_pos( &self, normalized_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setNormalizedPos(const QPointF& normalizedPos)
.
sourcepub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setPos(const QPointF& pos)
.
sourcepub unsafe fn set_pressure(&self, pressure: c_double)
pub unsafe fn set_pressure(&self, pressure: c_double)
Calls C++ function: void QTouchEvent::TouchPoint::setPressure(double pressure)
.
sourcepub unsafe fn set_raw_screen_positions(
&self,
positions: impl CastInto<Ref<QVectorOfQPointF>>
)
pub unsafe fn set_raw_screen_positions( &self, positions: impl CastInto<Ref<QVectorOfQPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setRawScreenPositions(const QVector<QPointF>& positions)
.
sourcepub unsafe fn set_rect(&self, rect: impl CastInto<Ref<QRectF>>)
pub unsafe fn set_rect(&self, rect: impl CastInto<Ref<QRectF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setRect(const QRectF& rect)
.
sourcepub unsafe fn set_rotation(&self, angle: c_double)
pub unsafe fn set_rotation(&self, angle: c_double)
Calls C++ function: void QTouchEvent::TouchPoint::setRotation(double angle)
.
sourcepub unsafe fn set_scene_pos(&self, scene_pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_scene_pos(&self, scene_pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setScenePos(const QPointF& scenePos)
.
sourcepub unsafe fn set_scene_rect(&self, scene_rect: impl CastInto<Ref<QRectF>>)
pub unsafe fn set_scene_rect(&self, scene_rect: impl CastInto<Ref<QRectF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setSceneRect(const QRectF& sceneRect)
.
sourcepub unsafe fn set_screen_pos(&self, screen_pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_screen_pos(&self, screen_pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setScreenPos(const QPointF& screenPos)
.
sourcepub unsafe fn set_screen_rect(&self, screen_rect: impl CastInto<Ref<QRectF>>)
pub unsafe fn set_screen_rect(&self, screen_rect: impl CastInto<Ref<QRectF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setScreenRect(const QRectF& screenRect)
.
sourcepub unsafe fn set_start_normalized_pos(
&self,
start_normalized_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_start_normalized_pos( &self, start_normalized_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setStartNormalizedPos(const QPointF& startNormalizedPos)
.
sourcepub unsafe fn set_start_pos(&self, start_pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_start_pos(&self, start_pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QTouchEvent::TouchPoint::setStartPos(const QPointF& startPos)
.
sourcepub unsafe fn set_start_scene_pos(
&self,
start_scene_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_start_scene_pos( &self, start_scene_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setStartScenePos(const QPointF& startScenePos)
.
sourcepub unsafe fn set_start_screen_pos(
&self,
start_screen_pos: impl CastInto<Ref<QPointF>>
)
pub unsafe fn set_start_screen_pos( &self, start_screen_pos: impl CastInto<Ref<QPointF>> )
Calls C++ function: void QTouchEvent::TouchPoint::setStartScreenPos(const QPointF& startScreenPos)
.
sourcepub unsafe fn set_state(&self, state: QFlags<TouchPointState>)
pub unsafe fn set_state(&self, state: QFlags<TouchPointState>)
Calls C++ function: void QTouchEvent::TouchPoint::setState(QFlags<Qt::TouchPointState> state)
.
sourcepub unsafe fn set_unique_id(&self, uid: i64)
pub unsafe fn set_unique_id(&self, uid: i64)
Calls C++ function: void QTouchEvent::TouchPoint::setUniqueId(qint64 uid)
.
sourcepub unsafe fn set_velocity(&self, v: impl CastInto<Ref<QVector2D>>)
pub unsafe fn set_velocity(&self, v: impl CastInto<Ref<QVector2D>>)
Calls C++ function: void QTouchEvent::TouchPoint::setVelocity(const QVector2D& v)
.
sourcepub unsafe fn start_normalized_pos(&self) -> CppBox<QPointF>
pub unsafe fn start_normalized_pos(&self) -> CppBox<QPointF>
Returns the normalized starting position of this touch point.
Calls C++ function: QPointF QTouchEvent::TouchPoint::startNormalizedPos() const
.
Returns the normalized starting position of this touch point.
The coordinates are normalized to the size of the touch device, i.e. (0,0) is the top-left corner and (1,1) is the bottom-right corner.
See also normalizedPos() and lastNormalizedPos().
sourcepub unsafe fn start_pos(&self) -> CppBox<QPointF>
pub unsafe fn start_pos(&self) -> CppBox<QPointF>
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that received the event.
Calls C++ function: QPointF QTouchEvent::TouchPoint::startPos() const
.
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that received the event.
sourcepub unsafe fn start_scene_pos(&self) -> CppBox<QPointF>
pub unsafe fn start_scene_pos(&self) -> CppBox<QPointF>
Returns the starting scene position of this touch point.
Calls C++ function: QPointF QTouchEvent::TouchPoint::startScenePos() const
.
Returns the starting scene position of this touch point.
The scene position is the position in QGraphicsScene coordinates if the QTouchEvent is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.
See also scenePos() and lastScenePos().
sourcepub unsafe fn start_screen_pos(&self) -> CppBox<QPointF>
pub unsafe fn start_screen_pos(&self) -> CppBox<QPointF>
Returns the starting screen position of this touch point.
Calls C++ function: QPointF QTouchEvent::TouchPoint::startScreenPos() const
.
Returns the starting screen position of this touch point.
See also screenPos() and lastScreenPos().
sourcepub unsafe fn state(&self) -> TouchPointState
pub unsafe fn state(&self) -> TouchPointState
Returns the current state of this touch point.
Calls C++ function: Qt::TouchPointState QTouchEvent::TouchPoint::state() const
.
Returns the current state of this touch point.
sourcepub unsafe fn swap(&self, other: impl CastInto<Ref<TouchPoint>>)
pub unsafe fn swap(&self, other: impl CastInto<Ref<TouchPoint>>)
Calls C++ function: void QTouchEvent::TouchPoint::swap(QTouchEvent::TouchPoint& other)
.
sourcepub unsafe fn unique_id(&self) -> CppBox<QPointingDeviceUniqueId>
pub unsafe fn unique_id(&self) -> CppBox<QPointingDeviceUniqueId>
Returns the unique ID of this touch point or token, if any.
Calls C++ function: QPointingDeviceUniqueId QTouchEvent::TouchPoint::uniqueId() const
.
Returns the unique ID of this touch point or token, if any.
It is normally invalid (see isValid()), because touchscreens cannot uniquely identify fingers. But when the Token flag is set, it is expected to uniquely identify a specific token (fiducial object).
This function was introduced in Qt 5.8.
See also flags.
sourcepub unsafe fn velocity(&self) -> CppBox<QVector2D>
pub unsafe fn velocity(&self) -> CppBox<QVector2D>
Returns a velocity vector for this touch point. The vector is in the screen's coordinate system, using pixels per seconds for the magnitude.
Calls C++ function: QVector2D QTouchEvent::TouchPoint::velocity() const
.
Returns a velocity vector for this touch point. The vector is in the screen’s coordinate system, using pixels per seconds for the magnitude.
Note: The returned vector is only valid if the touch device's capabilities include QTouchDevice::Velocity.
See also QTouchDevice::capabilities() and device().