QEventPoint#

The QEventPoint class provides information about a point in a QPointerEvent . More

Synopsis#

Properties#

  • accepted - The accepted state of the event point

  • device - The pointing device from which this event point originates

  • ellipseDiameters - The width and height of the bounding ellipse of the touch point

  • globalGrabPosition - The global position at which this point was grabbed

  • globalLastPosition - The global position of this point from the previous press or move event

  • globalPosition - The global position of this point

  • globalPressPosition - The global position at which this point was pressed

  • grabPosition - The position at which this point was grabbed

  • id - The ID number of this event point

  • lastPosition - The position of this point from the previous press or move event

  • lastTimestamp - The time from the previous QPointerEvent that contained this point

  • position - The position of this point

  • pressPosition - The position at which this point was pressed

  • pressTimestamp - The most recent time at which this point was pressed

  • pressure - The pressure of this point

  • rotation - The angular orientation of this point

  • sceneGrabPosition - The scene position at which this point was grabbed

  • sceneLastPosition - The scene position of this point from the previous press or move event

  • scenePosition - The scene position of this point

  • scenePressPosition - The scene position at which this point was pressed

  • state - The current state of the event point

  • timeHeld - The duration, in seconds, since this point was pressed and not released

  • timestamp - The most recent time at which this point was included in a QPointerEvent

  • uniqueId - The unique ID of this point or token, if any

  • velocity - Velocity vector, in units of pixels per second, in the coordinate. system of the screen or desktop

Functions#

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 PySide6.QtGui.QEventPoint(other)#

PySide6.QtGui.QEventPoint([id=-1[, device=None]])

PySide6.QtGui.QEventPoint(pointId, state, scenePosition, globalPosition)

Parameters:

Constructs an event point by making a shallow copy of other.

Constructs an event point with the given pointId, state, scenePosition and globalPosition.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtGui.QEventPoint.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 any QPointerEvent ; and delivery is done only when all points in a QPointerEvent have been accepted.

See also

accepted

Access functions:
property PᅟySide6.QtGui.QEventPoint.device: PySide6.QtGui.QPointingDevice#

This property holds the pointing device from which this event point originates..

Access functions:
property PᅟySide6.QtGui.QEventPoint.ellipseDiameters: PySide6.QtCore.QSizeF#

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:
property PᅟySide6.QtGui.QEventPoint.globalGrabPosition: PySide6.QtCore.QPointF#

This property holds the global position at which this point was grabbed..

The global position is relative to the screen or virtual desktop.

Access functions:
property PᅟySide6.QtGui.QEventPoint.globalLastPosition: PySide6.QtCore.QPointF#

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.

Access functions:
property PᅟySide6.QtGui.QEventPoint.globalPosition: PySide6.QtCore.QPointF#

This property holds the global position of this point..

The global position is relative to the screen or virtual desktop.

Access functions:
property PᅟySide6.QtGui.QEventPoint.globalPressPosition: PySide6.QtCore.QPointF#

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:
property PᅟySide6.QtGui.QEventPoint.grabPosition: PySide6.QtCore.QPointF#

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

position

Access functions:
property PᅟySide6.QtGui.QEventPoint.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:
property PᅟySide6.QtGui.QEventPoint.lastPosition: PySide6.QtCore.QPointF#

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.

Access functions:
property PᅟySide6.QtGui.QEventPoint.lastTimestamp: int#

This property holds the time from the previous QPointerEvent that contained this point..

Access functions:
property PᅟySide6.QtGui.QEventPoint.position: PySide6.QtCore.QPointF#

This property holds the position of this point..

The position is relative to the widget or item that received the event.

Access functions:
property PᅟySide6.QtGui.QEventPoint.pressPosition: PySide6.QtCore.QPointF#

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

position

Access functions:
property PᅟySide6.QtGui.QEventPoint.pressTimestamp: int#

This property holds the most recent time at which this point was pressed..

See also

timestamp

Access functions:
property PᅟySide6.QtGui.QEventPoint.pressure: float#

This property holds the pressure of this point..

The return value is in the range 0.0 to 1.0.

Access functions:
property PᅟySide6.QtGui.QEventPoint.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:
property PᅟySide6.QtGui.QEventPoint.sceneGrabPosition: PySide6.QtCore.QPointF#

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.

Access functions:
property PᅟySide6.QtGui.QEventPoint.sceneLastPosition: PySide6.QtCore.QPointF#

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.

Access functions:
property PᅟySide6.QtGui.QEventPoint.scenePosition: PySide6.QtCore.QPointF#

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.

Access functions:
property PᅟySide6.QtGui.QEventPoint.scenePressPosition: PySide6.QtCore.QPointF#

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 PᅟySide6.QtGui.QEventPoint.state: State#

This property holds the current state of the event point..

Access functions:
property PᅟySide6.QtGui.QEventPoint.timeHeld: float#

This property holds the duration, in seconds, since this point was pressed and not released..

Access functions:
property PᅟySide6.QtGui.QEventPoint.timestamp: int#

This property holds the most recent time at which this point was included in a QPointerEvent ..

See also

timestamp()

Access functions:
property PᅟySide6.QtGui.QEventPoint.uniqueId: PySide6.QtGui.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:
property PᅟySide6.QtGui.QEventPoint.velocity: PySide6.QtGui.QVector2D#

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 the Velocity 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.

Access functions:
PySide6.QtGui.QEventPoint.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.

PySide6.QtGui.QEventPoint.device()#
Return type:

PySide6.QtGui.QPointingDevice

Getter of property device .

PySide6.QtGui.QEventPoint.ellipseDiameters()#
Return type:

PySide6.QtCore.QSizeF

Getter of property ellipseDiameters .

PySide6.QtGui.QEventPoint.globalGrabPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property globalGrabPosition .

PySide6.QtGui.QEventPoint.globalLastPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property globalLastPosition .

PySide6.QtGui.QEventPoint.globalPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property globalPosition .

PySide6.QtGui.QEventPoint.globalPressPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property globalPressPosition .

PySide6.QtGui.QEventPoint.grabPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property grabPosition .

PySide6.QtGui.QEventPoint.id()#
Return type:

int

Getter of property id .

PySide6.QtGui.QEventPoint.isAccepted()#
Return type:

bool

Getter of property accepted .

PySide6.QtGui.QEventPoint.lastNormalizedPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

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.

PySide6.QtGui.QEventPoint.lastPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.lastPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property lastPosition .

PySide6.QtGui.QEventPoint.lastScenePos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.lastScreenPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.lastTimestamp()#
Return type:

int

Getter of property lastTimestamp .

PySide6.QtGui.QEventPoint.normalizedPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

Use normalizedPosition() instead.

PySide6.QtGui.QEventPoint.normalizedPosition()#
Return type:

PySide6.QtCore.QPointF

Returns the normalized position of this point.

The coordinates are calculated by transforming globalPosition() into the space of availableVirtualGeometry() , i.e. (0, 0) is the top-left corner and (1, 1) is the bottom-right corner.

See also

globalPosition

PySide6.QtGui.QEventPoint.__ne__(other)#
Parameters:

otherPySide6.QtGui.QEventPoint

Return type:

bool

Returns true if this event point is not equal to other, otherwise return false.

PySide6.QtGui.QEventPoint.__eq__(other)#
Parameters:

otherPySide6.QtGui.QEventPoint

Return type:

bool

Returns true if this event point is equal to other, otherwise return false.

PySide6.QtGui.QEventPoint.pos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

Use position() instead.

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

PySide6.QtGui.QEventPoint.position()#
Return type:

PySide6.QtCore.QPointF

Getter of property position .

PySide6.QtGui.QEventPoint.pressPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property pressPosition .

PySide6.QtGui.QEventPoint.pressTimestamp()#
Return type:

int

Getter of property pressTimestamp .

PySide6.QtGui.QEventPoint.pressure()#
Return type:

float

Getter of property pressure .

PySide6.QtGui.QEventPoint.rotation()#
Return type:

float

Getter of property rotation .

PySide6.QtGui.QEventPoint.sceneGrabPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property sceneGrabPosition .

PySide6.QtGui.QEventPoint.sceneLastPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property sceneLastPosition .

PySide6.QtGui.QEventPoint.scenePos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.scenePosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property scenePosition .

PySide6.QtGui.QEventPoint.scenePressPosition()#
Return type:

PySide6.QtCore.QPointF

Getter of property scenePressPosition .

PySide6.QtGui.QEventPoint.screenPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.setAccepted([accepted=true])#
Parameters:

accepted – bool

See also

isAccepted()

Setter of property accepted .

PySide6.QtGui.QEventPoint.startNormalizedPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

Use globalPressPosition() instead.

Returns the normalized press position of this point.

PySide6.QtGui.QEventPoint.startPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.startScenePos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.startScreenPos()#
Return type:

PySide6.QtCore.QPointF

Note

This function is deprecated.

PySide6.QtGui.QEventPoint.state()#
Return type:

State

Getter of property state .

PySide6.QtGui.QEventPoint.swap(other)#
Parameters:

otherPySide6.QtGui.QEventPoint

PySide6.QtGui.QEventPoint.timeHeld()#
Return type:

float

Getter of property timeHeld .

PySide6.QtGui.QEventPoint.timestamp()#
Return type:

int

Getter of property timestamp .

PySide6.QtGui.QEventPoint.uniqueId()#
Return type:

PySide6.QtGui.QPointingDeviceUniqueId

Getter of property uniqueId .

PySide6.QtGui.QEventPoint.velocity()#
Return type:

PySide6.QtGui.QVector2D

Getter of property velocity .