qt5base-lts/tests/auto/widgets/kernel
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
..
qaction Remove QGuiAction again and split QAction implementation up instead 2020-03-29 11:18:57 +01:00
qactiongroup Remove QGuiAction again and split QAction implementation up instead 2020-03-29 11:18:57 +01:00
qapplication QApplication: deliver all wheel events to widget that accepts the first 2020-04-25 01:34:04 +02:00
qboxlayout Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qdesktopwidget cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
qformlayout Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qgesturerecognizer Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qgridlayout Remove deprecated QStyle enum values 2020-04-16 16:53:18 +02:00
qlayout Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qshortcut Merge remote-tracking branch 'origin/dev' into merge-dev 2020-01-24 13:17:33 +01:00
qsizepolicy Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qstackedlayout Merge remote-tracking branch 'origin/dev' into wip/cmake 2019-11-19 13:53:21 +01:00
qtooltip Merge remote-tracking branch 'origin/dev' into wip/cmake 2019-11-19 13:53:21 +01:00
qwidget Deprecate QGuiApplication::fontChanged() signal 2020-04-24 10:10:55 +02:00
qwidget_window Don't send QEvent::Hide to an already hidden top level widget 2020-04-24 17:40:36 +02:00
qwidgetaction Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qwidgetmetatype cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
qwidgetsvariant cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
qwindowcontainer Merge remote-tracking branch 'origin/dev' into wip/cmake 2019-11-19 13:53:21 +01:00
CMakeLists.txt cmake: add widgets/kernel tests 2019-10-31 09:49:03 +00:00
kernel.pro Fix inversed qmake logic for widget action tests 2020-02-20 09:05:28 +01:00