forked from qt-creator/qt-creator
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:
@@ -235,8 +235,10 @@ bool LiteHtmlHelpViewer::eventFilter(QObject *src, QEvent *e)
|
|||||||
{
|
{
|
||||||
if (isScrollWheelZoomingEnabled() && e->type() == QEvent::Wheel) {
|
if (isScrollWheelZoomingEnabled() && e->type() == QEvent::Wheel) {
|
||||||
auto we = static_cast<QWheelEvent *>(e);
|
auto we = static_cast<QWheelEvent *>(e);
|
||||||
if (we->modifiers() == Qt::ControlModifier)
|
if (we->modifiers() == Qt::ControlModifier) {
|
||||||
|
e->ignore();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return HelpViewer::eventFilter(src, e);
|
return HelpViewer::eventFilter(src, e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user