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 Change-Id: Ib3f99792518364cf6e635cf4c6fda088051a7848 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 1653ae13db69a2e703a1b44d3e67b55e927a5eca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f4fc178316
commit
e510a6eefa
@ -2982,6 +2982,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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user