qt6-bb10/tests/auto/widgets/kernel/qapplication
Volker Hilsheimer bc205d81e7 QApplication: deliver all wheel events to widget that accepts the first
For kinetic wheel events, Qt tries to make sure that all events in the
stream go to the widget that accepted the first wheel event.

It did so by directing all events from the stream to the widget from
which the spontaneous event was returned as accepted.
However, that widget might have passed the event on to some other
widgets; e.g QScrollArea forwards wheel events from the viewport to the
relevant scroll bar. The event might then have come back accepted only
because parent propagation kicked in (the scrollbar might not accept
the event, so the parents get a chance, and some parent's scrollbar
ultimately accepts the event).

In this scenario, the wheel widget would be the viewport under the
mouse, when it should have been the scrollbar of the parent. The
next events from the stream were then delivered to a widget that didn't
scroll; and parent propagation is not (and should not be) implemented
for the case where Qt has a wheel widget.

Instead, make the first widget that accepts any initial wheel event
the wheel widget, even if the event was not spontaneous. With this
change, all events from the stream are delivered to the widget that
actually handled the event. That has the effect that ie. a viewport
of a scroll area only gets the first event; all following events are
delivered directly to the scrollbar.

The test case added simulates the different scenarios - nesting of
scroll areas, classic wheel events and a stream of kinetic wheel
events.

[ChangeLog][QtWidgets][QApplication] Wheel events from a device that
creates an event stream are correctly delivered to the widget that
accepts the first wheel event in the stream.

Change-Id: I5ebfc7789b5c32ebc8d881686f450fa05ec92cfe
Fixes: QTBUG-79102
Pick-to: 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-25 01:34:04 +02:00
..
desktopsettingsaware Regenerate qtbase tests and src/* for some small fixes 2019-11-13 13:36:09 +00:00
modal Regenerate qtbase tests and src/* for some small fixes 2019-11-13 13:36:09 +00:00
test Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
tmp Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
.gitignore Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
BLACKLIST Update for failures only on dev branch. Use general platform names 2019-08-19 18:22:11 +02:00
CMakeLists.txt cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
heart.svg Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
qapplication.pro Fix compilation for WinRT 2015-12-14 08:43:15 +00:00
tst_qapplication.cpp QApplication: deliver all wheel events to widget that accepts the first 2020-04-25 01:34:04 +02:00