内容表

上一话题

QTextOption.Tab

下一话题

QTextBlock.iterator

QTouchEvent.TouchPoint

TouchPoint class provides information about a touch point in a QTouchEvent . 更多

Inheritance diagram of PySide2.QtGui.QTouchEvent.TouchPoint

4.6 版新增。

概要

函数

详细描述

PySide2/QtGui/images/touchpoint-metrics.png
class PySide2.QtGui.QTouchEvent. TouchPoint ( other )

PySide2.QtGui.QTouchEvent.TouchPoint([id=-1])

param id

int

param other

TouchPoint

构造 TouchPoint for use in a QTouchEvent .

PySide2.QtGui.QTouchEvent.TouchPoint. InfoFlag

The values of this enum describe additional information about a touch point.

常量

描述

QTouchEvent.TouchPoint.Pen

Indicates that the contact has been made by a designated pointing device (e.g. a pen) instead of a finger.

QTouchEvent.TouchPoint.Token

Indicates that the contact has been made by a fiducial object (e.g. a knob or other token) instead of a finger.

PySide2.QtGui.QTouchEvent.TouchPoint. ellipseDiameters ( )
返回类型

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

PySide2.QtGui.QTouchEvent.TouchPoint. flags ( )
返回类型

InfoFlags

Returns additional information about the touch point.

另请参阅

InfoFlags

PySide2.QtGui.QTouchEvent.TouchPoint. id ( )
返回类型

int

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.

PySide2.QtGui.QTouchEvent.TouchPoint. lastNormalizedPos ( )
返回类型

QPointF

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.

PySide2.QtGui.QTouchEvent.TouchPoint. lastPos ( )
返回类型

QPointF

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

PySide2.QtGui.QTouchEvent.TouchPoint. lastScenePos ( )
返回类型

QPointF

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.

PySide2.QtGui.QTouchEvent.TouchPoint. lastScreenPos ( )
返回类型

QPointF

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

PySide2.QtGui.QTouchEvent.TouchPoint. normalizedPos ( )
返回类型

QPointF

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.

PySide2.QtGui.QTouchEvent.TouchPoint. pos ( )
返回类型

QPointF

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

PySide2.QtGui.QTouchEvent.TouchPoint. pressure ( )
返回类型

qreal

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

PySide2.QtGui.QTouchEvent.TouchPoint. rawScreenPositions ( )
返回类型

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

注意

Returns an empty vector if the touch device’s capabilities do not include 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.

另请参阅

capabilities() device() window()

PySide2.QtGui.QTouchEvent.TouchPoint. rect ( )
返回类型

QRectF

注意

此函数被弃用。

This function is deprecated since 5.9 because it returns the outer bounds 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() .

PySide2.QtGui.QTouchEvent.TouchPoint. rotation ( )
返回类型

qreal

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.

PySide2.QtGui.QTouchEvent.TouchPoint. scenePos ( )
返回类型

QPointF

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.

PySide2.QtGui.QTouchEvent.TouchPoint. sceneRect ( )
返回类型

QRectF

注意

此函数被弃用。

This function is deprecated since 5.9 because it returns the outer bounds 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() .

PySide2.QtGui.QTouchEvent.TouchPoint. screenPos ( )
返回类型

QPointF

Returns the screen position of this touch point.

PySide2.QtGui.QTouchEvent.TouchPoint. screenRect ( )
返回类型

QRectF

注意

此函数被弃用。

This function is deprecated since 5.9 because it returns the outer bounds of the touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position screenPos() with ellipseDiameters() which are independent of rotation() .

PySide2.QtGui.QTouchEvent.TouchPoint. setEllipseDiameters ( dia )
参数

dia QSizeF

PySide2.QtGui.QTouchEvent.TouchPoint. setFlags ( flags )
参数

flags InfoFlags

另请参阅

flags()

PySide2.QtGui.QTouchEvent.TouchPoint. setId ( id )
参数

id int

另请参阅

id()

PySide2.QtGui.QTouchEvent.TouchPoint. setLastNormalizedPos ( lastNormalizedPos )
参数

lastNormalizedPos QPointF

PySide2.QtGui.QTouchEvent.TouchPoint. setLastPos ( lastPos )
参数

lastPos QPointF

另请参阅

lastPos()

PySide2.QtGui.QTouchEvent.TouchPoint. setLastScenePos ( lastScenePos )
参数

lastScenePos QPointF

另请参阅

lastScenePos()

PySide2.QtGui.QTouchEvent.TouchPoint. setLastScreenPos ( lastScreenPos )
参数

lastScreenPos QPointF

另请参阅

lastScreenPos()

PySide2.QtGui.QTouchEvent.TouchPoint. setNormalizedPos ( normalizedPos )
参数

normalizedPos QPointF

另请参阅

normalizedPos()

PySide2.QtGui.QTouchEvent.TouchPoint. setPos ( pos )
参数

pos QPointF

另请参阅

pos()

PySide2.QtGui.QTouchEvent.TouchPoint. setPressure ( pressure )
参数

pressure qreal

另请参阅

pressure()

PySide2.QtGui.QTouchEvent.TouchPoint. setRawScreenPositions ( positions )
参数

positions

PySide2.QtGui.QTouchEvent.TouchPoint. setRect ( rect )
参数

rect QRectF

注意

此函数被弃用。

另请参阅

rect()

PySide2.QtGui.QTouchEvent.TouchPoint. setRotation ( angle )
参数

angle qreal

另请参阅

rotation()

PySide2.QtGui.QTouchEvent.TouchPoint. setScenePos ( scenePos )
参数

scenePos QPointF

另请参阅

scenePos()

PySide2.QtGui.QTouchEvent.TouchPoint. setSceneRect ( sceneRect )
参数

sceneRect QRectF

注意

此函数被弃用。

另请参阅

sceneRect()

PySide2.QtGui.QTouchEvent.TouchPoint. setScreenPos ( screenPos )
参数

screenPos QPointF

另请参阅

screenPos()

PySide2.QtGui.QTouchEvent.TouchPoint. setScreenRect ( screenRect )
参数

screenRect QRectF

注意

此函数被弃用。

另请参阅

screenRect()

PySide2.QtGui.QTouchEvent.TouchPoint. setStartNormalizedPos ( startNormalizedPos )
参数

startNormalizedPos QPointF

PySide2.QtGui.QTouchEvent.TouchPoint. setStartPos ( startPos )
参数

startPos QPointF

另请参阅

startPos()

PySide2.QtGui.QTouchEvent.TouchPoint. setStartScenePos ( startScenePos )
参数

startScenePos QPointF

另请参阅

startScenePos()

PySide2.QtGui.QTouchEvent.TouchPoint. setStartScreenPos ( startScreenPos )
参数

startScreenPos QPointF

另请参阅

startScreenPos()

PySide2.QtGui.QTouchEvent.TouchPoint. setState ( state )
参数

state TouchPointStates

另请参阅

state()

PySide2.QtGui.QTouchEvent.TouchPoint. setUniqueId ( uid )
参数

uid qint64

另请参阅

uniqueId()

PySide2.QtGui.QTouchEvent.TouchPoint. setVelocity ( v )
参数

v QVector2D

另请参阅

velocity()

PySide2.QtGui.QTouchEvent.TouchPoint. startNormalizedPos ( )
返回类型

QPointF

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.

PySide2.QtGui.QTouchEvent.TouchPoint. startPos ( )
返回类型

QPointF

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

另请参阅

pos() lastPos()

PySide2.QtGui.QTouchEvent.TouchPoint. startScenePos ( )
返回类型

QPointF

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.

PySide2.QtGui.QTouchEvent.TouchPoint. startScreenPos ( )
返回类型

QPointF

Returns the starting screen position of this touch point.

PySide2.QtGui.QTouchEvent.TouchPoint. state ( )
返回类型

TouchPointState

Returns the current state of this touch point.

PySide2.QtGui.QTouchEvent.TouchPoint. swap ( other )
参数

other TouchPoint

PySide2.QtGui.QTouchEvent.TouchPoint. uniqueId ( )
返回类型

QPointingDeviceUniqueId

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

另请参阅

flags

PySide2.QtGui.QTouchEvent.TouchPoint. velocity ( )
返回类型

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.

注意

The returned vector is only valid if the touch device’s capabilities include Velocity .

另请参阅

capabilities() device()