Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QMutableEventPoint Class Reference

#include <qeventpoint_p.h>

+ Collaboration diagram for QMutableEventPoint:

Static Public Member Functions

static QEventPoint withTimeStamp (ulong timestamp, int pointId, QEventPoint::State state, QPointF position, QPointF scenePosition, QPointF globalPosition)
 
static Q_GUI_EXPORT void update (const QEventPoint &from, QEventPoint &to)
 
static Q_GUI_EXPORT void detach (QEventPoint &p)
 
static Q_GUI_EXPORT void setTimestamp (QEventPoint &p, ulong t)
 
static QWindowwindow (const QEventPoint &p)
 
static QObjecttarget (const QEventPoint &p)
 

Detailed Description

Definition at line 87 of file qeventpoint_p.h.

Member Function Documentation

◆ detach()

void QMutableEventPoint::detach ( QEventPoint & p)
static

This class is explicitly shared, which means if you construct an event and then the point(s) that it holds are modified before the event is delivered, the event will be seen to hold the modified points. The workaround is that any code which modifies an eventpoint that could already be included in an event, or code that wants to save an eventpoint for later, has responsibility to detach before calling any setters, so as to hold and modify an independent copy. (The independent copy can then be used in a subsequent event.)

Definition at line 483 of file qeventpoint.cpp.

Referenced by QQuickDeliveryAgentPrivate::clonePointerEvent(), QQuickDeliveryAgentPrivate::compressTouchEvent(), QQuickItemPrivate::localizedTouchEvent(), setTimestamp(), and update().

+ Here is the caller graph for this function:

◆ setTimestamp()

void QMutableEventPoint::setTimestamp ( QEventPoint & p,
ulong t )
static

Set the timestamp from the event that updated this point's positions, and calculate a new value for velocity().

The velocity calculation is done here because none of the QPointerEvent subclass constructors take the timestamp directly, and because QGuiApplication traditionally constructs an event first and then sets its timestamp (see for example QGuiApplicationPrivate::processMouseEvent()).

This function looks up the corresponding instance in QPointingDevicePrivate::activePoints, and assumes that its timestamp() still holds the previous time when this point was updated, its velocity() holds this point's last-known velocity, and its globalPosition() and globalLastPosition() hold this point's current and previous positions, respectively. We assume timestamps are in milliseconds.

The velocity calculation is skipped if the platform has promised to provide velocities already by setting the QInputDevice::Velocity capability.

Definition at line 560 of file qeventpoint.cpp.

References detach(), QPointingDevicePrivate::get(), QEventPointPrivate::globalLastPos, QEventPointPrivate::globalPos, QEventPointPrivate::lastTimestamp, QEventPoint::Pressed, QEventPointPrivate::pressTimestamp, qCDebug, QEventPointPrivate::timestamp, QEventPointPrivate::velocity, and QInputDevice::Velocity.

Referenced by QQuickDeliveryAgentPrivate::clonePointerEvent(), QGuiApplicationPrivate::processTouchEvent(), and QPointerEvent::setTimestamp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ target()

static QObject * QMutableEventPoint::target ( const QEventPoint & p)
inlinestatic

Definition at line 132 of file qeventpoint_p.h.

Referenced by QApplicationPrivate::activateImplicitTouchGrab(), QApplicationPrivate::findClosestTouchPointTarget(), QPointingDevicePrivate::firstActiveTarget(), QApplicationPrivate::translateRawTouchEvent(), and QApplicationPrivate::translateTouchCancel().

+ Here is the caller graph for this function:

◆ update()

void QMutableEventPoint::update ( const QEventPoint & other,
QEventPoint & target )
static

Update target state from the other point, assuming that target contains state from the previous event and other contains new values that came in from a device.

That is: global position and other valuators will be updated, but the following properties will not be updated:

\list

  • properties that are not likely to be set after a fresh touchpoint has been received from a device
  • properties that should be persistent between events (such as grabbers) \endlist

Definition at line 505 of file qeventpoint.cpp.

References detach(), other(), QEventPoint::Pressed, QEventPoint::Released, and setPosition().

Referenced by QGuiApplicationPrivate::processTouchEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ window()

static QWindow * QMutableEventPoint::window ( const QEventPoint & p)
inlinestatic

Definition at line 128 of file qeventpoint_p.h.

Referenced by QPointingDevicePrivate::firstActiveWindow(), and QGuiApplicationPrivate::processTouchEvent().

+ Here is the caller graph for this function:

◆ withTimeStamp()

static QEventPoint QMutableEventPoint::withTimeStamp ( ulong timestamp,
int pointId,
QEventPoint::State state,
QPointF position,
QPointF scenePosition,
QPointF globalPosition )
inlinestatic

Definition at line 90 of file qeventpoint_p.h.

References position(), and state.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: