diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-08-19 22:45:17 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-09-16 14:47:36 +0200 |
commit | 1fdbbb49d9f2d2bb62e151a29e5615031af6606a (patch) | |
tree | 7017337c0b95c5f4628945a111889ade98553d6a /src/gui/kernel/qevent.h | |
parent | 2692237bb1b0c0f50b7cc5d920eb8ab065063d47 (diff) |
Calculate velocity in QMutEventPoint::setTimestamp() with Kalman filter
This functionality was only in Qt Quick in Qt 5. Now we move it up to QtGui
so that every QEventPoint will have a valid velocity() before being delivered
anywhere.
[ChangeLog][QtGui][QPointerEvent] Every QEventPoint should now carry a valid
velocity(): if the operating system doesn't provide it, Qt will calculate it,
using a simple Kalman filter to provide a weighted average over time.
Fixes: QTBUG-33891
Change-Id: I40352f717f0ad6edd87cf71ef55e955a591eeea1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 195fd1ae77..7f9a780959 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -157,6 +157,7 @@ public: int id() const; QPointingDeviceUniqueId uniqueId() const; ulong timestamp() const; + ulong lastTimestamp() const; ulong pressTimestamp() const; qreal timeHeld() const; qreal pressure() const; |