summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-08-13 10:46:00 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-08-16 18:37:26 +0200
commit1653ae13db69a2e703a1b44d3e67b55e927a5eca (patch)
treed91e3703a4fd9a321aa9a21853439287ad02f2ea /src/widgets/kernel/qapplication.cpp
parent864ecea83b7fd993d518d9a2c6c2d64710aed6f0 (diff)
Accept the QWheelEvent before each propagation step
Input events in Qt are accepted when constructed, and ignored by the default event handler (so overriding the event handler is enough to accept an event). Since we use the same QWheelEvent instance for each propagation step, we need to reset the event to be accepted before each delivery so that an earlier child ignoring the event doesn't result in the event being ignored without explicit acceptance. Amends the refactoring of wheel event delivery in 92df790f46b3a8b17aec2f385d6472fd3f8647f6. Task-number: QTBUG-95552 Task-number: QTBUG-79102 Task-number: QTBUG-67032 Pick-to: 6.1 6.2 Change-Id: Ib3f99792518364cf6e635cf4c6fda088051a7848 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 70ec46ed32..3d2554dd32 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2979,6 +2979,9 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
we.setTimestamp(wheel->timestamp());
bool eventAccepted;
do {
+ // events are delivered as accepted and ignored by the default event handler
+ // since we always send the same QWheelEvent object, we need to reset the accepted state
+ we.setAccepted(true);
we.m_spont = wheel->spontaneous() && w == receiver;
res = d->notify_helper(w, &we);
eventAccepted = we.isAccepted();