Go to file
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
bin Merge remote-tracking branch 'origin/5.15' into dev 2020-04-22 15:28:01 +02:00
cmake CMake: Allow sqldriver plugins to be built as standalone 2020-04-24 07:41:13 +02:00
coin Coin: Fix incorrect target OS values used in instructions 2020-04-02 09:39:27 +02:00
config.tests CMake: Skip regeneration of manual compile test project 2020-04-09 11:26:46 +02:00
dist Add changes file for Qt 5.14.2 2020-03-17 06:16:25 +01:00
doc Merge remote-tracking branch 'origin/5.15' into dev 2020-04-22 15:28:01 +02:00
examples Do not mention Qt XML's SAX API anymore in examples/xml/README 2020-04-24 09:47:41 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
mkspecs Remove checks for glibc < 2 from qplatformdefs.h files 2020-04-23 06:41:32 +02:00
qmake Merge remote-tracking branch 'origin/5.15' into dev 2020-04-22 15:28:01 +02:00
src QApplication: deliver all wheel events to widget that accepts the first 2020-04-25 01:34:04 +02:00
tests QApplication: deliver all wheel events to widget that accepts the first 2020-04-25 01:34:04 +02:00
util QChar: port low-level functions from uint/ushort to char32/16_t 2020-04-24 12:45:53 +02:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Add .vscode in git ignore list 2020-04-22 20:38:52 -03:00
.qmake.conf Bump version 2019-12-17 12:41:31 +01:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt CMake: Fix pkgconfig calls when cross-compiling 2020-03-26 12:46:16 +01:00
config_help.txt Merge remote-tracking branch 'origin/5.15' into dev 2020-02-26 18:39:21 +01:00
configure Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
configure.bat Don't compile qmake in c++11 mode 2020-02-03 17:43:30 +01:00
configure.cmake CMake: Port the 'static_runtime' feature 2020-04-23 10:09:15 +02:00
configure.json CMake: Port the 'separate_debug_info' feature 2020-03-06 13:38:37 +01:00
configure.pri Android: Increase minimum API level to Android-23 / Android 6 2020-03-04 08:28:04 +01:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
header.BSD Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.COMM Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.FDL Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.GPL Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.GPL-EXCEPT Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL3 Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL3-COMM Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL-NOGPL2 Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL-ONLY Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.MIT qsimd: add support for new x86 CPU features 2018-05-05 06:20:07 +00:00
INSTALL INSTALL: Remove outdated reference to Windows CE 2019-02-13 13:01:57 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt 2018-04-16 11:02:14 +00:00
LICENSE.QT-LICENSE-AGREEMENT Update enterprise license agreement v4.2.1 2019-12-18 13:07:19 +02:00
qtbase.pro nuke configure -host-option 2016-12-13 18:55:59 +00:00
sync.profile Move QOpenGLWidget from QtOpenGL to its own module 2020-02-18 09:22:51 +01:00