#[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.

C++ documentation:

The TouchPoint class provides information about a touch point in a QTouchEvent.

Implementations§

source§

impl TouchPoint

source

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).

source

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.

C++ documentation:

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.

source

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.

C++ documentation:

Returns additional information about the touch point.

See also QTouchEvent::TouchPoint::InfoFlags.

source

pub unsafe fn id(&self) -> c_int

Returns the id number of this touch point.

Calls C++ function: int QTouchEvent::TouchPoint::id() const.

C++ documentation:

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.

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

Returns the position of this touch point from the previous touch event, relative to the widget or QGraphicsItem that received the event.

See also pos() and startPos().

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

Returns the screen position of this touch point from the previous touch event.

See also screenPos() and startScreenPos().

source

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.

source

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().

C++ documentation:

The TouchPoint class provides information about a touch point in a QTouchEvent.

source

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.

source

pub unsafe fn normalized_pos(&self) -> CppBox<QPointF>

Returns the normalized position of this touch point.

Calls C++ function: QPointF QTouchEvent::TouchPoint::normalizedPos() const.

C++ documentation:

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().

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

Returns the pressure of this touch point. The return value is in the range 0.0 to 1.0.

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

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.

source

pub unsafe fn scene_pos(&self) -> CppBox<QPointF>

Returns the scene position of this touch point.

Calls C++ function: QPointF QTouchEvent::TouchPoint::scenePos() const.

C++ documentation:

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().

source

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.

C++ documentation:

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().

source

pub unsafe fn screen_pos(&self) -> CppBox<QPointF>

Returns the screen position of this touch point.

Calls C++ function: QPointF QTouchEvent::TouchPoint::screenPos() const.

C++ documentation:

Returns the screen position of this touch point.

See also startScreenPos(), lastScreenPos(), and pos().

source

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.

C++ documentation:

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().

source

pub unsafe fn set_ellipse_diameters(&self, dia: impl CastInto<Ref<QSizeF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setEllipseDiameters(const QSizeF& dia).

source

pub unsafe fn set_flags(&self, flags: QFlags<InfoFlag>)

Calls C++ function: void QTouchEvent::TouchPoint::setFlags(QFlags<QTouchEvent::TouchPoint::InfoFlag> flags).

source

pub unsafe fn set_id(&self, id: c_int)

Calls C++ function: void QTouchEvent::TouchPoint::setId(int id).

source

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).

source

pub unsafe fn set_last_pos(&self, last_pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setLastPos(const QPointF& lastPos).

source

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).

source

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).

source

pub unsafe fn set_normalized_pos( &self, normalized_pos: impl CastInto<Ref<QPointF>> )

Calls C++ function: void QTouchEvent::TouchPoint::setNormalizedPos(const QPointF& normalizedPos).

source

pub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setPos(const QPointF& pos).

source

pub unsafe fn set_pressure(&self, pressure: c_double)

Calls C++ function: void QTouchEvent::TouchPoint::setPressure(double pressure).

source

pub unsafe fn set_raw_screen_positions( &self, positions: impl CastInto<Ref<QVectorOfQPointF>> )

Calls C++ function: void QTouchEvent::TouchPoint::setRawScreenPositions(const QVector<QPointF>& positions).

source

pub unsafe fn set_rect(&self, rect: impl CastInto<Ref<QRectF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setRect(const QRectF& rect).

source

pub unsafe fn set_rotation(&self, angle: c_double)

Calls C++ function: void QTouchEvent::TouchPoint::setRotation(double angle).

source

pub unsafe fn set_scene_pos(&self, scene_pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setScenePos(const QPointF& scenePos).

source

pub unsafe fn set_scene_rect(&self, scene_rect: impl CastInto<Ref<QRectF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setSceneRect(const QRectF& sceneRect).

source

pub unsafe fn set_screen_pos(&self, screen_pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setScreenPos(const QPointF& screenPos).

source

pub unsafe fn set_screen_rect(&self, screen_rect: impl CastInto<Ref<QRectF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setScreenRect(const QRectF& screenRect).

source

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).

source

pub unsafe fn set_start_pos(&self, start_pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QTouchEvent::TouchPoint::setStartPos(const QPointF& startPos).

source

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).

source

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).

source

pub unsafe fn set_state(&self, state: QFlags<TouchPointState>)

Calls C++ function: void QTouchEvent::TouchPoint::setState(QFlags<Qt::TouchPointState> state).

source

pub unsafe fn set_unique_id(&self, uid: i64)

Calls C++ function: void QTouchEvent::TouchPoint::setUniqueId(qint64 uid).

source

pub unsafe fn set_velocity(&self, v: impl CastInto<Ref<QVector2D>>)

Calls C++ function: void QTouchEvent::TouchPoint::setVelocity(const QVector2D& v).

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

Returns the starting position of this touch point, relative to the widget or QGraphicsItem that received the event.

See also pos() and lastPos().

source

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.

C++ documentation:

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().

source

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.

C++ documentation:

Returns the starting screen position of this touch point.

See also screenPos() and lastScreenPos().

source

pub unsafe fn state(&self) -> TouchPointState

Returns the current state of this touch point.

Calls C++ function: Qt::TouchPointState QTouchEvent::TouchPoint::state() const.

C++ documentation:

Returns the current state of this touch point.

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<TouchPoint>>)

Calls C++ function: void QTouchEvent::TouchPoint::swap(QTouchEvent::TouchPoint& other).

source

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.

C++ documentation:

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.

source

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.

C++ documentation:

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().

Trait Implementations§

source§

impl CppDeletable for TouchPoint

source§

unsafe fn delete(&self)

Calls C++ function: [destructor] void QTouchEvent::TouchPoint::~TouchPoint().

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.