[][src]Struct qt_gui::q_touch_event::TouchPoint

#[repr(C)]
pub struct TouchPoint { /* fields omitted */ }

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.

Methods

impl TouchPoint[src]

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<TouchPoint>>
) -> MutRef<TouchPoint>
[src]

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

pub unsafe fn ellipse_diameters(&self) -> CppBox<QSizeF>[src]

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.

pub unsafe fn flags(&self) -> QFlags<InfoFlag>[src]

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.

pub unsafe fn id(&self) -> c_int[src]

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.

pub unsafe fn last_normalized_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn last_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn last_scene_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn last_screen_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn new_1a(id: c_int) -> CppBox<TouchPoint>[src]

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.

pub unsafe fn new_0a() -> CppBox<TouchPoint>[src]

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.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<TouchPoint>>
) -> CppBox<TouchPoint>
[src]

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.

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

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

pub unsafe fn pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn pressure(&self) -> c_double[src]

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.

pub unsafe fn raw_screen_positions(&self) -> CppBox<QVectorOfQPointF>[src]

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

pub unsafe fn rect(&self) -> CppBox<QRectF>[src]

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

pub unsafe fn rotation(&self) -> c_double[src]

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.

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

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

pub unsafe fn scene_rect(&self) -> CppBox<QRectF>[src]

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

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

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

pub unsafe fn screen_rect(&self) -> CppBox<QRectF>[src]

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

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

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

pub unsafe fn set_flags(&mut self, flags: QFlags<InfoFlag>)[src]

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

pub unsafe fn set_id(&mut self, id: c_int)[src]

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

pub unsafe fn set_last_normalized_pos(
    &mut self,
    last_normalized_pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QTouchEvent::TouchPoint::setLastNormalizedPos(const QPointF& lastNormalizedPos).

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

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

pub unsafe fn set_last_scene_pos(
    &mut self,
    last_scene_pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QTouchEvent::TouchPoint::setLastScenePos(const QPointF& lastScenePos).

pub unsafe fn set_last_screen_pos(
    &mut self,
    last_screen_pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QTouchEvent::TouchPoint::setLastScreenPos(const QPointF& lastScreenPos).

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

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

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

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

pub unsafe fn set_pressure(&mut self, pressure: c_double)[src]

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

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

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

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

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

pub unsafe fn set_rotation(&mut self, angle: c_double)[src]

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

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

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

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

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

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

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

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

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

pub unsafe fn set_start_normalized_pos(
    &mut self,
    start_normalized_pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QTouchEvent::TouchPoint::setStartNormalizedPos(const QPointF& startNormalizedPos).

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

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

pub unsafe fn set_start_scene_pos(
    &mut self,
    start_scene_pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QTouchEvent::TouchPoint::setStartScenePos(const QPointF& startScenePos).

pub unsafe fn set_start_screen_pos(
    &mut self,
    start_screen_pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QTouchEvent::TouchPoint::setStartScreenPos(const QPointF& startScreenPos).

pub unsafe fn set_state(&mut self, state: QFlags<TouchPointState>)[src]

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

pub unsafe fn set_unique_id(&mut self, uid: i64)[src]

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

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

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

pub unsafe fn start_normalized_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn start_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn start_scene_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn start_screen_pos(&self) -> CppBox<QPointF>[src]

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

pub unsafe fn state(&self) -> TouchPointState[src]

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.

pub unsafe fn swap(&mut self, other: impl CastInto<MutRef<TouchPoint>>)[src]

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

pub unsafe fn unique_id(&self) -> CppBox<QPointingDeviceUniqueId>[src]

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.

pub unsafe fn velocity(&self) -> CppBox<QVector2D>[src]

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

impl CppDeletable for TouchPoint[src]

unsafe fn delete(&mut self)[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.