QTouchEvent.TouchPoint¶
The
TouchPoint
class provides information about a touch point in aQTouchEvent
. More…
New in version 4.6.
Synopsis¶
Functions¶
def
ellipseDiameters
()def
flags
()def
id
()def
lastNormalizedPos
()def
lastPos
()def
lastScenePos
()def
lastScreenPos
()def
normalizedPos
()def
pos
()def
pressure
()def
rawScreenPositions
()def
rect
()def
rotation
()def
scenePos
()def
sceneRect
()def
screenPos
()def
screenRect
()def
setEllipseDiameters
(dia)def
setFlags
(flags)def
setId
(id)def
setLastNormalizedPos
(lastNormalizedPos)def
setLastPos
(lastPos)def
setLastScenePos
(lastScenePos)def
setLastScreenPos
(lastScreenPos)def
setNormalizedPos
(normalizedPos)def
setPos
(pos)def
setPressure
(pressure)def
setRawScreenPositions
(positions)def
setRect
(rect)def
setRotation
(angle)def
setScenePos
(scenePos)def
setSceneRect
(sceneRect)def
setScreenPos
(screenPos)def
setScreenRect
(screenRect)def
setStartNormalizedPos
(startNormalizedPos)def
setStartPos
(startPos)def
setStartScenePos
(startScenePos)def
setStartScreenPos
(startScreenPos)def
setState
(state)def
setUniqueId
(uid)def
setVelocity
(v)def
startNormalizedPos
()def
startPos
()def
startScenePos
()def
startScreenPos
()def
state
()def
swap
(other)def
uniqueId
()def
velocity
()
Detailed Description¶
-
class
PySide2.QtGui.QTouchEvent.
TouchPoint
(other)¶ PySide2.QtGui.QTouchEvent.TouchPoint([id=-1])
- param id
int
- param other
TouchPoint
Constructs a
TouchPoint
for use in aQTouchEvent
.
-
PySide2.QtGui.QTouchEvent.TouchPoint.
InfoFlag
¶ The values of this enum describe additional information about a touch point.
Constant
Description
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
()¶ - Return type
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
()¶ - Return type
InfoFlags
Returns additional information about the touch point.
See also
InfoFlags
-
PySide2.QtGui.QTouchEvent.TouchPoint.
id
()¶ - Return type
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
()¶ - Return type
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.
See also
normalizedPos()
startNormalizedPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
lastPos
()¶ - Return type
QPointF
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()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
lastScenePos
()¶ - Return type
QPointF
Returns the scene position of this touch point from the previous touch event.
The scene position is the position in
QGraphicsScene
coordinates if theQTouchEvent
is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.See also
scenePos()
startScenePos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
lastScreenPos
()¶ - Return type
QPointF
Returns the screen position of this touch point from the previous touch event.
See also
screenPos()
startScreenPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
normalizedPos
()¶ - Return type
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.
See also
startNormalizedPos()
lastNormalizedPos()
pos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
pos
()¶ - Return type
QPointF
Returns the position of this touch point, relative to the widget or
QGraphicsItem
that received the event.See also
startPos()
lastPos()
screenPos()
scenePos()
normalizedPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
pressure
()¶ - Return type
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
()¶ - Return type
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 bywindow()
.Note
Returns an empty vector if the touch device’s capabilities do not include
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
capabilities()
device()
window()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
rect
()¶ - Return type
QRectF
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 bypos()
.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()
withellipseDiameters()
which are independent ofrotation()
.See also
scenePos()
ellipseDiameters()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
rotation
()¶ - Return type
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
()¶ - Return type
QPointF
Returns the scene position of this touch point.
The scene position is the position in
QGraphicsScene
coordinates if theQTouchEvent
is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.See also
startScenePos()
lastScenePos()
pos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
sceneRect
()¶ - Return type
QRectF
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()
withellipseDiameters()
which are independent ofrotation()
.See also
scenePos()
ellipseDiameters()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
screenPos
()¶ - Return type
QPointF
Returns the screen position of this touch point.
See also
startScreenPos()
lastScreenPos()
pos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
screenRect
()¶ - Return type
QRectF
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()
withellipseDiameters()
which are independent ofrotation()
.See also
screenPos()
ellipseDiameters()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setEllipseDiameters
(dia)¶ - Parameters
dia –
QSizeF
See also
ellipseDiameters()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setFlags
(flags)¶ - Parameters
flags –
InfoFlags
See also
flags()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setId
(id)¶ - Parameters
id –
int
See also
id()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setLastNormalizedPos
(lastNormalizedPos)¶ - Parameters
lastNormalizedPos –
QPointF
See also
lastNormalizedPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setLastPos
(lastPos)¶ - Parameters
lastPos –
QPointF
See also
lastPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setLastScenePos
(lastScenePos)¶ - Parameters
lastScenePos –
QPointF
See also
lastScenePos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setLastScreenPos
(lastScreenPos)¶ - Parameters
lastScreenPos –
QPointF
See also
lastScreenPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setNormalizedPos
(normalizedPos)¶ - Parameters
normalizedPos –
QPointF
See also
normalizedPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setPos
(pos)¶ - Parameters
pos –
QPointF
See also
pos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setPressure
(pressure)¶ - Parameters
pressure –
qreal
See also
pressure()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setRawScreenPositions
(positions)¶ - Parameters
positions –
See also
rawScreenPositions()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setRect
(rect)¶ - Parameters
rect –
QRectF
See also
rect()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setRotation
(angle)¶ - Parameters
angle –
qreal
See also
rotation()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setScenePos
(scenePos)¶ - Parameters
scenePos –
QPointF
See also
scenePos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setSceneRect
(sceneRect)¶ - Parameters
sceneRect –
QRectF
See also
sceneRect()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setScreenPos
(screenPos)¶ - Parameters
screenPos –
QPointF
See also
screenPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setScreenRect
(screenRect)¶ - Parameters
screenRect –
QRectF
See also
screenRect()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setStartNormalizedPos
(startNormalizedPos)¶ - Parameters
startNormalizedPos –
QPointF
See also
startNormalizedPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setStartPos
(startPos)¶ - Parameters
startPos –
QPointF
See also
startPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setStartScenePos
(startScenePos)¶ - Parameters
startScenePos –
QPointF
See also
startScenePos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setStartScreenPos
(startScreenPos)¶ - Parameters
startScreenPos –
QPointF
See also
startScreenPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setState
(state)¶ - Parameters
state –
TouchPointStates
See also
state()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
setUniqueId
(uid)¶ - Parameters
uid –
qint64
See also
uniqueId()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
startNormalizedPos
()¶ - Return type
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.
See also
normalizedPos()
lastNormalizedPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
startPos
()¶ - Return type
QPointF
Returns the starting position of this touch point, relative to the widget or
QGraphicsItem
that received the event.See also
pos()
lastPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
startScenePos
()¶ - Return type
QPointF
Returns the starting scene position of this touch point.
The scene position is the position in
QGraphicsScene
coordinates if theQTouchEvent
is handled by a QGraphicsItem::touchEvent() reimplementation, and identical to the screen position for widgets.See also
scenePos()
lastScenePos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
startScreenPos
()¶ - Return type
QPointF
Returns the starting screen position of this touch point.
See also
screenPos()
lastScreenPos()
-
PySide2.QtGui.QTouchEvent.TouchPoint.
state
()¶ - Return type
TouchPointState
Returns the current state of this touch point.
-
PySide2.QtGui.QTouchEvent.TouchPoint.
swap
(other)¶ - Parameters
other –
TouchPoint
-
PySide2.QtGui.QTouchEvent.TouchPoint.
uniqueId
()¶ - Return type
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 theToken
flag is set, it is expected to uniquely identify a specific token (fiducial object).See also
flags
-
PySide2.QtGui.QTouchEvent.TouchPoint.
velocity
()¶ - Return type
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
Velocity
.See also
capabilities()
device()
© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.