Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

TouchPoint Class

(QTouchEvent::TouchPoint)

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

 #include <QTouchEvent>

This class was introduced in Qt 4.6.

Public Types

enum InfoFlag { Pen }
flags InfoFlags

Public Functions

TouchPoint(const TouchPoint & other)
InfoFlags flags() const
int id() const
QPointF lastNormalizedPos() const
QPointF lastPos() const
QPointF lastScenePos() const
QPointF lastScreenPos() const
QPointF normalizedPos() const
QPointF pos() const
qreal pressure() const
QVector<QPointF> rawScreenPositions() const
QRectF rect() const
QPointF scenePos() const
QRectF sceneRect() const
QPointF screenPos() const
QRectF screenRect() const
void setFlags(InfoFlags flags)
QPointF startNormalizedPos() const
QPointF startPos() const
QPointF startScenePos() const
QPointF startScreenPos() const
Qt::TouchPointState state() const
QVector2D velocity() const
TouchPoint & operator=(const TouchPoint & other)

Detailed Description

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

Member Type Documentation

enum TouchPoint::InfoFlag
flags TouchPoint::InfoFlags

The InfoFlags type is a typedef for QFlags<InfoFlag>. It stores an OR combination of InfoFlag values.

Member Function Documentation

TouchPoint::TouchPoint(const TouchPoint & other)

InfoFlags TouchPoint::flags() const

Returns additional information about the touch point.

See also setFlags() and QTouchEvent::TouchPoint::InfoFlags.

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

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

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

See also pos() and startPos().

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

QPointF TouchPoint::lastScreenPos() const

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

See also screenPos() and startScreenPos().

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

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

qreal TouchPoint::pressure() const

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

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

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

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

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

See also scenePos() and rect().

QPointF TouchPoint::screenPos() const

Returns the screen position of this touch point.

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

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

See also screenPos() and rect().

void TouchPoint::setFlags(InfoFlags flags)

See also flags().

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

QPointF TouchPoint::startPos() const

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

See also pos() and lastPos().

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

QPointF TouchPoint::startScreenPos() const

Returns the starting screen position of this touch point.

See also screenPos() and lastScreenPos().

Qt::TouchPointState TouchPoint::state() const

Returns the current state of this touch point.

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

TouchPoint & TouchPoint::operator=(const TouchPoint & other)

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web