TouchPoint 类

( QTouchEvent::TouchPoint )

The TouchPoint 类提供的信息有关触摸点在 QTouchEvent . 更多...

头: #include <TouchPoint>
qmake: QT += gui
Since: Qt 4.6

公共类型

enum InfoFlag { Pen, Token }
flags InfoFlags

公共函数

TouchPoint (TouchPoint && other )
QSizeF ellipseDiameters () const
TouchPoint::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
qreal rotation () const
QPointF scenePos () const
QPointF screenPos () const
QPointF startNormalizedPos () const
QPointF startPos () const
QPointF startScenePos () const
QPointF startScreenPos () const
Qt::TouchPointState state () const
QPointingDeviceUniqueId uniqueId () const
QVector2D velocity () const

详细描述

The TouchPoint 类提供的信息有关触摸点在 QTouchEvent .

成员类型文档编制

enum TouchPoint:: InfoFlag
flags TouchPoint:: InfoFlags

此枚举的值描述有关触摸点的额外信息。

常量 描述
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::Token 0x0002 Indicates that the contact has been made by a fiducial object (e.g. a knob or other token) instead of a finger.

InfoFlags 类型是 typedef 对于 QFlags <InfoFlag>。它存储 InfoFlag 值的 OR 组合。

成员函数文档编制

TouchPoint:: TouchPoint ( TouchPoint && other )

移动构造 TouchPoint 实例,使它指向同一对象 other 所指向的。

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

该函数在 Qt 5.9 引入。

TouchPoint::InfoFlags TouchPoint:: flags () const

返回有关触摸点的额外信息。

另请参阅 QTouchEvent::TouchPoint::InfoFlags .

int TouchPoint:: id () const

返回此触摸点的 ID 号。

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.

另请参阅 normalizedPos () 和 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.

另请参阅 pos () 和 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.

另请参阅 scenePos () 和 startScenePos ().

QPointF TouchPoint:: lastScreenPos () const

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

另请参阅 screenPos () 和 startScreenPos ().

QPointF TouchPoint:: normalizedPos () const

返回此触摸点的规范化位置。

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.

另请参阅 startNormalizedPos (), lastNormalizedPos (),和 pos ().

QPointF TouchPoint:: pos () const

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

另请参阅 startPos (), lastPos (), screenPos (), scenePos (),和 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 返回通过 QTouchEvent::window ().

注意: Returns an empty vector if the touch device's capabilities do not include QTouchDevice::RawPositions .

注意: 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.

该函数在 Qt 5.0 引入。

另请参阅 QTouchDevice::capabilities (), device (),和 window ().

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

该函数在 Qt 5.8 引入。

QPointF TouchPoint:: scenePos () const

返回此触摸点的场景位置。

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.

另请参阅 startScenePos (), lastScenePos (),和 pos ().

QPointF TouchPoint:: screenPos () const

Returns the screen position of this touch point.

另请参阅 startScreenPos (), lastScreenPos (),和 pos ().

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.

另请参阅 normalizedPos () 和 lastNormalizedPos ().

QPointF TouchPoint:: startPos () const

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

另请参阅 pos () 和 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.

另请参阅 scenePos () 和 lastScenePos ().

QPointF TouchPoint:: startScreenPos () const

Returns the starting screen position of this touch point.

另请参阅 screenPos () 和 lastScreenPos ().

Qt::TouchPointState TouchPoint:: state () const

Returns the current state of this touch point.

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

该函数在 Qt 5.8 引入。

另请参阅 flags .

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.

注意: The returned vector is only valid if the touch device's capabilities include QTouchDevice::Velocity .

另请参阅 QTouchDevice::capabilities () 和 device ().