Ignore the wheel event explicitly in order to propagate it further

Qt 6 brings a behavioral change regarding delivery of wheel events:
92df790f46b3a8b17aec2f385d6472fd3f8647f6 and
2a857ee28315c5bacfe2ecaf402ca9005b35c20e. If there is an event
filter installed and wheel event is being processed, the event
is now accepted by default, which means that after returning
true from eventFilter(), the event is not propagated anymore.
Since we want to redirect the event to the parent HelpViewer object,
we explicitly ignore the event prior to returning true.

Task-number: QTCREATORBUG-26369
Change-Id: I2fc8b7c8bfbc343a9ca7951684ced405f8a55039
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Jarek Kobus
2021-10-06 11:35:05 +02:00
parent 4bea534c62
commit 0b96a1b76b

View File

@@ -235,9 +235,11 @@ bool LiteHtmlHelpViewer::eventFilter(QObject *src, QEvent *e)
{
if (isScrollWheelZoomingEnabled() && e->type() == QEvent::Wheel) {
auto we = static_cast<QWheelEvent *>(e);
if (we->modifiers() == Qt::ControlModifier)
if (we->modifiers() == Qt::ControlModifier) {
e->ignore();
return true;
}
}
return HelpViewer::eventFilter(src, e);
}