The TouchPoint class provides information about a touch point in a QTouchEvent.
More...
The TouchPoint class provides information about a touch point in a QTouchEvent.
- See also
- normalizedPos(), startNormalizedPos()
The values of this enum describe additional information about a touch point.
Constant | Value | Description |
QTouchEvent::TouchPoint::Pen | 0x0001 | Indicates that the contact has been made by a designated pointing device (e.g. a pen) instead of a finger. |
QTouchEvent::TouchPoint::TouchPoint |
( |
const QTouchEvent::TouchPoint & |
other | ) |
|
Copy constructs a new QTouchEvent::TouchPoint from other.
QTouchEvent::TouchPoint::TouchPoint |
( |
TouchPoint && |
other | ) |
|
|
inline |
InfoFlags QTouchEvent::TouchPoint::flags |
( |
| ) |
const |
int QTouchEvent::TouchPoint::id |
( |
| ) |
const |
Returns the id number of this touch point. Id numbers are globally sequential, starting at zero, meaning the first touch point in the application has id 0, the second has id 1, and so on.
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(), startNormalizedPos()
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.
- See also
- pos(), startPos()
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(), startScenePos()
QPointF QTouchEvent::TouchPoint::lastScreenPos |
( |
| ) |
const |
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(), pos()
QTouchEvent::TouchPoint & QTouchEvent::TouchPoint::operator= |
( |
const QTouchEvent::TouchPoint & |
other | ) |
|
|
inline |
Copy assigns from other and returns a reference to this object.
TouchPoint & QTouchEvent::TouchPoint::operator= |
( |
TouchPoint && |
other | ) |
|
|
inline |
Move assigns from other and returns a reference to this object.
QPointF QTouchEvent::TouchPoint::pos |
( |
| ) |
const |
qreal QTouchEvent::TouchPoint::pressure |
( |
| ) |
const |
Returns the pressure of this touch point. The return value is in the range 0.0 to 1.0.
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(). 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.
- See also
- QTouchDevice::capabilities(), device(), window()
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(). Returns an empty rect if the device does not report touch point sizes.
QPointF QTouchEvent::TouchPoint::scenePos |
( |
| ) |
const |
QRectF QTouchEvent::TouchPoint::sceneRect |
( |
| ) |
const |
Returns the rect for this touch point in scene coordinates. An empty rect is returned if the device does not report touch point sizes.
- See also
- scenePos(), rect()
QPointF QTouchEvent::TouchPoint::screenPos |
( |
| ) |
const |
QRectF QTouchEvent::TouchPoint::screenRect |
( |
| ) |
const |
Returns the rect for this touch point in screen coordinates. An empty rect is returned if the device does not report touch point sizes.
- See also
- screenPos(), rect()
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(), lastNormalizedPos()
QPointF QTouchEvent::TouchPoint::startPos |
( |
| ) |
const |
Returns the starting position of this touch point, relative to the widget or QGraphicsItem that received the event.
- See also
- pos(), lastPos()
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(), lastScenePos()
QPointF QTouchEvent::TouchPoint::startScreenPos |
( |
| ) |
const |
Returns the current state of this touch point.
void QTouchEvent::TouchPoint::swap |
( |
TouchPoint & |
other | ) |
|
|
inline |
Swaps the touch point event other with this touch point event. This operation is very fast and never fails.
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(), device()