cabana: fix mouse wheel not scrolling charts when hovering over tips (#33747)

fix mouse wheel not scrolling charts when hovering over tips
pull/33751/head
Dean Lee 10 months ago committed by GitHub
parent 6547d9593c
commit 19fdf90585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      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<TipLabel *>(o) != nullptr;
auto global_pos = static_cast<QMouseEvent *>(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<TipLabel *>(o)) {
// Forward the event to the parent widget
QCoreApplication::sendEvent(tip->parentWidget(), e);
}
}
return false;
}

Loading…
Cancel
Save