From 19fdf90585173b43831993e4d3c00fef8fe5ae6e Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Wed, 9 Oct 2024 02:20:29 +0800 Subject: [PATCH] cabana: fix mouse wheel not scrolling charts when hovering over tips (#33747) fix mouse wheel not scrolling charts when hovering over tips --- tools/cabana/chart/chartswidget.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/cabana/chart/chartswidget.cc b/tools/cabana/chart/chartswidget.cc index 27846f9c92..8154a85d6b 100644 --- a/tools/cabana/chart/chartswidget.cc +++ b/tools/cabana/chart/chartswidget.cc @@ -434,7 +434,9 @@ void ChartsWidget::alignCharts() { } bool ChartsWidget::eventFilter(QObject *o, QEvent *e) { - if (value_tip_visible_ && e->type() == QEvent::MouseMove) { + if (!value_tip_visible_) return false; + + if (e->type() == QEvent::MouseMove) { bool on_tip = qobject_cast(o) != nullptr; auto global_pos = static_cast(e)->globalPos(); @@ -449,6 +451,11 @@ bool ChartsWidget::eventFilter(QObject *o, QEvent *e) { } showValueTip(-1); + } else if (e->type() == QEvent::Wheel) { + if (auto tip = qobject_cast(o)) { + // Forward the event to the parent widget + QCoreApplication::sendEvent(tip->parentWidget(), e); + } } return false; }