- class QEventPoint¶
The
QEventPoint
class provides information about a point in aQPointerEvent
. More…Synopsis¶
Properties¶
acceptedᅟ
- The accepted state of the event pointdeviceᅟ
- The pointing device from which this event point originatesellipseDiametersᅟ
- The width and height of the bounding ellipse of the touch pointglobalGrabPositionᅟ
- The global position at which this point was grabbedglobalLastPositionᅟ
- The global position of this point from the previous press or move eventglobalPositionᅟ
- The global position of this pointglobalPressPositionᅟ
- The global position at which this point was pressedgrabPositionᅟ
- The position at which this point was grabbedidᅟ
- The ID number of this event pointlastPositionᅟ
- The position of this point from the previous press or move eventlastTimestampᅟ
- The time from the previous QPointerEvent that contained this pointpositionᅟ
- The position of this pointpressPositionᅟ
- The position at which this point was pressedpressTimestampᅟ
- The most recent time at which this point was pressedpressureᅟ
- The pressure of this pointrotationᅟ
- The angular orientation of this pointsceneGrabPositionᅟ
- The scene position at which this point was grabbedsceneLastPositionᅟ
- The scene position of this point from the previous press or move eventscenePositionᅟ
- The scene position of this pointscenePressPositionᅟ
- The scene position at which this point was pressedstateᅟ
- The current state of the event pointtimeHeldᅟ
- The duration, in seconds, since this point was pressed and not releasedtimestampᅟ
- The most recent time at which this point was included in a QPointerEventuniqueIdᅟ
- The unique ID of this point or token, if anyvelocityᅟ
- Velocity vector, in units of pixels per second, in the coordinate. system of the screen or desktop
Methods¶
def
__init__()
def
device()
def
globalPosition()
def
grabPosition()
def
id()
def
isAccepted()
def
lastPos()
def
lastPosition()
def
lastScenePos()
def
lastScreenPos()
def
lastTimestamp()
def
normalizedPos()
def
__ne__()
def
__eq__()
def
pos()
def
position()
def
pressPosition()
def
pressTimestamp()
def
pressure()
def
rotation()
def
scenePos()
def
scenePosition()
def
screenPos()
def
setAccepted()
def
startPos()
def
startScenePos()
def
startScreenPos()
def
state()
def
swap()
def
timeHeld()
def
timestamp()
def
uniqueId()
def
velocity()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
- class State¶
Specifies the state of this event point.
Constant
Description
QEventPoint.Unknown
Unknown state.
QEventPoint.Stationary
The event point did not move.
QEventPoint.Pressed
The touch point or button is pressed.
QEventPoint.Updated
The event point was updated.
QEventPoint.Released
The touch point or button was released.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property acceptedᅟ: bool¶
This property holds the accepted state of the event point..
In widget-based applications, this property is not used, as it’s only meaningful for a widget to accept or reject a complete
QInputEvent
.In Qt Quick however, it’s normal for an Item or Event Handler to accept only the individual points in a
QTouchEvent
that are actually participating in a gesture, while other points can be delivered to other items or handlers. For the sake of consistency, that applies to anyQPointerEvent
; and delivery is done only when all points in aQPointerEvent
have been accepted.See also
accepted
- Access functions:
- property deviceᅟ: QPointingDevice¶
This property holds the pointing device from which this event point originates..
- Access functions:
This property holds the width and height of the bounding ellipse of the touch point..
The return value is in logical pixels. Most touchscreens do not detect the shape of the contact point, and no mice or tablet devices can detect it, so a null size is the most common value. On some touchscreens the diameters may be nonzero and always equal (the ellipse is approximated as a circle).
- Access functions:
This property holds the global position at which this point was grabbed..
The global position is relative to the screen or virtual desktop.
See also
- Access functions:
This property holds the global position of this point from the previous press or move event..
The global position is relative to the screen or virtual desktop.
See also
- Access functions:
This property holds the global position of this point..
The global position is relative to the screen or virtual desktop.
See also
- Access functions:
This property holds the global position at which this point was pressed..
The global position is relative to the screen or virtual desktop.
- Access functions:
This property holds the position at which this point was grabbed..
The position is relative to the widget or item that received the event.
See also
- Access functions:
- property idᅟ: int¶
This property holds the ID number of this event point..
Note
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.
- Access functions:
This property holds the position of this point from the previous press or move event..
The position is relative to the widget or item that received the event.
See also
- Access functions:
- property lastTimestampᅟ: int¶
This property holds the time from the previous
QPointerEvent
that contained this point..See also
- Access functions:
This property holds the position of this point..
The position is relative to the widget or item that received the event.
- Access functions:
This property holds the position at which this point was pressed..
The position is relative to the widget or item that received the event.
See also
- Access functions:
- property pressTimestampᅟ: int¶
This property holds the most recent time at which this point was pressed..
See also
- Access functions:
- property pressureᅟ: float¶
This property holds the pressure of this point..
The return value is in the range
0.0
to1.0
.- Access functions:
- property rotationᅟ: float¶
This property holds the angular orientation of this point..
The return value is in degrees, where zero (the default) indicates the finger, token or stylus 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.
- Access functions:
This property holds the scene position at which this point was grabbed..
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event(), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
See also
- Access functions:
This property holds the scene position of this point from the previous press or move event..
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event(), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
See also
- Access functions:
This property holds the scene position of this point..
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event(), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
See also
- Access functions:
This property holds the scene position at which this point was pressed..
The scene position is the position relative to QQuickWindow if handled in QQuickItem::event(), in QGraphicsScene coordinates if handled by an override of QGraphicsItem::touchEvent(), or the window position in widget applications.
- Access functions:
- property stateᅟ: QEventPoint.State¶
This property holds the current state of the event point..
- Access functions:
- property timeHeldᅟ: float¶
This property holds the duration, in seconds, since this point was pressed and not released..
See also
- Access functions:
- property timestampᅟ: int¶
This property holds the most recent time at which this point was included in a
QPointerEvent
..See also
timestamp()
- Access functions:
- property uniqueIdᅟ: QPointingDeviceUniqueId¶
This property holds the unique ID of this point or token, if any..
It is often invalid (see
isValid()
), because touchscreens cannot uniquely identify fingers.When it comes from a
QTabletEvent
, it identifies the serial number of the stylus in use.It may identify a specific token (fiducial object) when the TUIO driver is in use with a touchscreen that supports them.
- Access functions:
This property holds a velocity vector, in units of pixels per second, in the coordinate. system of the screen or desktop..
Note
If the device’s capabilities include
Velocity
, it means velocity comes from the operating system (perhaps the touch hardware or driver provides it). But usually theVelocity
capability is not set, indicating that the velocity is calculated by Qt, using a simple Kalman filter to provide a smoothed average velocity rather than an instantaneous value. Effectively it tells how fast and in what direction the user has been dragging this point over the last few events, with the most recent event having the strongest influence.See also
- Access functions:
- __init__(other)¶
- Parameters:
other –
QEventPoint
Constructs an event point by making a shallow copy of
other
.- __init__([id=-1[, device=None]])
- Parameters:
id – int
device –
QPointingDevice
- __init__(pointId, state, scenePosition, globalPosition)
Constructs an event point with the given
pointId
,state
,scenePosition
andglobalPosition
.- device()¶
- Return type:
Getter of property
deviceᅟ
.Getter of property
ellipseDiametersᅟ
.Getter of property
globalGrabPositionᅟ
.Getter of property
globalLastPositionᅟ
.Getter of property
globalPositionᅟ
.Getter of property
globalPressPositionᅟ
.Getter of property
grabPositionᅟ
.- id()¶
- Return type:
int
Getter of property
idᅟ
.- isAccepted()¶
- Return type:
bool
Getter of property
acceptedᅟ
.Use
globalLastPosition()
instead.Returns the normalized position of this point from the previous press or move event.
The coordinates are normalized to
availableVirtualGeometry()
, i.e.(0, 0)
is the top-left corner and(1, 1)
is the bottom-right corner.Getter of property
lastPositionᅟ
.- lastTimestamp()¶
- Return type:
int
Getter of property
lastTimestampᅟ
.Use
normalizedPosition()
instead.Returns the normalized position of this point.
The coordinates are calculated by transforming
globalPosition()
into the space ofavailableVirtualGeometry()
, i.e.(0, 0)
is the top-left corner and(1, 1)
is the bottom-right corner.See also
- __ne__(other)¶
- Parameters:
other –
QEventPoint
- Return type:
bool
Returns
true
if this event point is not equal toother
, otherwise returnfalse
.- __eq__(other)¶
- Parameters:
other –
QEventPoint
- Return type:
bool
Returns
true
if this event point is equal toother
, otherwise returnfalse
.Use
position()
instead.Returns the position of this point, relative to the widget or item that received the event.
Getter of property
positionᅟ
.Getter of property
pressPositionᅟ
.- pressTimestamp()¶
- Return type:
int
Getter of property
pressTimestampᅟ
.- pressure()¶
- Return type:
float
Getter of property
pressureᅟ
.- rotation()¶
- Return type:
float
Getter of property
rotationᅟ
.Getter of property
sceneGrabPositionᅟ
.Getter of property
sceneLastPositionᅟ
.Getter of property
scenePositionᅟ
.Getter of property
scenePressPositionᅟ
.- setAccepted([accepted=true])¶
- Parameters:
accepted – bool
See also
Setter of property
acceptedᅟ
.Use
globalPressPosition()
instead.Returns the normalized press position of this point.
Getter of property
stateᅟ
.- swap(other)¶
- Parameters:
other –
QEventPoint
- timeHeld()¶
- Return type:
float
Getter of property
timeHeldᅟ
.- timestamp()¶
- Return type:
int
Getter of property
timestampᅟ
.- uniqueId()¶
- Return type:
Getter of property
uniqueIdᅟ
.Getter of property
velocityᅟ
.