diff options
author | Shawn Rutledge <[email protected]> | 2024-06-17 20:44:04 -0700 |
---|---|---|
committer | Shawn Rutledge <[email protected]> | 2024-06-28 17:12:14 -0700 |
commit | 0debcf3ed3f62416be1c172454f420119df0587e (patch) | |
tree | cfb3bb664151bd87d07f34d19f98160ff0f058ba /tests/auto/quick/qquicktext/tst_qquicktext.cpp | |
parent | 3b6355fbaab2559dab301c803780768295089637 (diff) |
Call QQuickItem::mouseUngrabEvent() on ungrab from QTabletEvent
As long as we rely on QGuiApplicationPrivate::processTabletEvent() to
synthesize mouse events from tablet events (we aren't doing it on the
fly as with touch events in 468626e99a90d6ac21cb311cde05c658ccb3b781),
and as long as most QQuickItems are not handling tablet events,
QQuickDeliveryAgentPrivate::onGrabChanged() almost always sees a
QMouseEvent losing its grab when e.g. ListView takes over from one of
its delegates while the user is trying to scroll with a stylus device.
This event's device is the stylus, though.
Whenever we see an EventPoint being canceled or ungrabbed, we must call
either mouseUngrabEvent() on the item, or touchUngrabEvent() if all the
points are released or cancelled, to avoid items getting "stuck" in
pressed state. It must not be skipped. So call mouseUngrabEvent()
whenever the event is a QSinglePointEvent, and touchUngrabEvent()
otherwise (since only touchscreens send multi-point events).
Make QQuickTest::pointerPress/Move/Release functions more correct for
stylus devices:
- we need the timestamp to monotonically increase, even though
QTest::defaultMouseDelay() is usually 0 (which isn't sensible)
- QTest::mouseEvent() calls qt_handleMouseEvent which converts
logical coordinates to native positions; but for tablet events,
do it here for now, since there are no QTest methods to generate them.
This helps QQuickFlickablePrivate::handleMoveEvent() to calculate
deltas correctly.
Fixes: QTBUG-118903
Pick-to: 6.8 6.7 6.6 6.5
Change-Id: I5ec54c5181f5b9137fe16248884010aea94f671a
Reviewed-by: Doris Verria <[email protected]>
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
0 files changed, 0 insertions, 0 deletions