diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-10 08:30:37 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-15 12:29:27 +0100 |
commit | cfca4188f9d294cca9be96ae98ba0ed311be21b7 (patch) | |
tree | e0203a1df9a3217bfc83ec1e821e6062f5a597cd /src/gui | |
parent | 7d63efc16f65f98c657caa90e0d7e9b72a879ade (diff) |
tests: port to new QMutableEventPoint static API
This code didn't actually use QMutableEventPoint::from(), so didn't
run into the UB that from() depended on, but it's in the way of making
QMutableEventPoint a befriendable namespace instead of a public
subclass of QEventPoint.
Replaced the QMutableEventPoint ctor that takes a timestamp, and
therefore isn't compatible with the ctors on QEventPoint, with a
static function that returns QEventPoint instead.
Port QList initialization to braced-initialization as a drive-by.
Task-number: QTBUG-99615
Pick-to: 6.3
Change-Id: If5a1dbea21cc31cdefdb640716793421c8ec0af4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qeventpoint_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qeventpoint_p.h b/src/gui/kernel/qeventpoint_p.h index caadb49ca5..83e48b6e0c 100644 --- a/src/gui/kernel/qeventpoint_p.h +++ b/src/gui/kernel/qeventpoint_p.h @@ -133,6 +133,15 @@ public: d->pos = position; } + static QEventPoint withTimeStamp(ulong timestamp, int pointId, QEventPoint::State state, + QPointF position, QPointF scenePosition, QPointF globalPosition) + { + QEventPoint p(pointId, state, scenePosition, globalPosition); + p.d->timestamp = timestamp; + p.d->pos = position; + return p; + } + static void update(const QEventPoint &from, QEventPoint &to); void detach() { detach(*this); } |