diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-03-26 14:10:28 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-04-27 20:12:50 +0200 |
commit | 31f90e99b8f04d9a228c5a0b01319b3f112c1490 (patch) | |
tree | c9253bb4457b7d0572f78647f848ea7eff338139 /tests | |
parent | 62f5a6ca4274d72bab78db4bc374c481717871b0 (diff) |
Add storage for (pixel) deltas and fingerCount to QNativeGestureEvent
It's not clear now whether trackpad gestures on Windows will need to be
so different than on macOS; however, any reasonable int value can be
stored in a qreal, and in Qt Quick we like to use floating-point numbers
for all "real" values and measurements. So since we need to add more
storage, and quint64 m_intValue has never been used, we now replace it
with a QVector2D, which should have the same size. The intended use
is that PanNativeGesture will include a displacement, probably in
pixels, by which the viewport or some target item should be panned or
moved. The naming of deltas() is flexible enough to support any gesture
with some incremental 2D valuators, though, just as value() has
gesture-dependent semantics.
fingerCount() will be useful for Qt Quick pointer handlers to filter
out events that have the wrong number of fingers, e.g. to require that
either a 3-finger pan gesture or 3 individual touchpoints are required
to activate DragHandler { minimumPointCount: 3 } (assuming we implement
pan gesture support in DragHandler).
Fixes: QTBUG-92179
Task-number: QTBUG-92098
Change-Id: I5462aea9047beed6e99075294a62011edd8a59f5
Reviewed-by: Povilas Kanapickas <povilas@radix.lt>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions