![]() |
Qt 6.x
The Qt SDK
|
#include <qeventpoint_p.h>
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 QWindow * | window (const QEventPoint &p) |
static QObject * | target (const QEventPoint &p) |
Definition at line 85 of file qeventpoint_p.h.
|
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().
|
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 559 of file qeventpoint.cpp.
References detach(), QPointingDevicePrivate::EventPointData::eventPoint, QExplicitlySharedDataPointer< T >::get(), QPointingDevicePrivate::get(), QEventPointPrivate::globalLastPos, QEventPointPrivate::globalPos, QEventPointPrivate::lastTimestamp, QPointingDevicePrivate::pointById(), QEventPoint::Pressed, QEventPointPrivate::pressTimestamp, qCDebug, QEventPointPrivate::timestamp, QEventPointPrivate::velocity, and QInputDevice::Velocity.
Referenced by QQuickDeliveryAgentPrivate::clonePointerEvent(), QGuiApplicationPrivate::processTouchEvent(), and QPointerEvent::setTimestamp().
|
inlinestatic |
Definition at line 130 of file qeventpoint_p.h.
Referenced by QApplicationPrivate::activateImplicitTouchGrab(), QApplicationPrivate::findClosestTouchPointTarget(), QPointingDevicePrivate::firstActiveTarget(), QApplicationPrivate::translateRawTouchEvent(), and QApplicationPrivate::translateTouchCancel().
|
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
Definition at line 505 of file qeventpoint.cpp.
References detach(), other(), QEventPoint::Pressed, QEventPoint::Released, and setPosition().
Referenced by QGuiApplicationPrivate::processTouchEvent().
|
inlinestatic |
Definition at line 126 of file qeventpoint_p.h.
Referenced by QPointingDevicePrivate::firstActiveWindow(), and QGuiApplicationPrivate::processTouchEvent().
|
inlinestatic |
Definition at line 88 of file qeventpoint_p.h.
References position(), and state.