From 1408b838438ded0381b719b65df1a8fc2b587c69 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 30 Mar 2023 21:37:49 +0200 Subject: [PATCH] cabana: fix parts of chart widget not being redrawn (#27742) * cabana: fix parts of chart widget not being redrawn * revert others --- tools/cabana/chartswidget.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cabana/chartswidget.cc b/tools/cabana/chartswidget.cc index 148e075414b700..09ee9f1cff9502 100644 --- a/tools/cabana/chartswidget.cc +++ b/tools/cabana/chartswidget.cc @@ -528,7 +528,7 @@ void ChartView::updatePlot(double cur, double min, double max) { updateAxisY(); updateSeriesPoints(); } - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } void ChartView::updateSeriesPoints() { @@ -716,7 +716,7 @@ void ChartView::mouseReleaseEvent(QMouseEvent *event) { } else if (rubber->width() > 10) { emit zoomIn(min_rounded, max_rounded); } else { - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } event->accept(); } else if (!can->liveStreaming() && event->button() == Qt::RightButton) { @@ -774,7 +774,7 @@ void ChartView::mouseMoveEvent(QMouseEvent *ev) { text_list.push_front(QString::number(chart()->mapToValue({x, 0}).x(), 'f', 3)); QPointF tooltip_pt(x + 12, plot_area.top() - 20); QToolTip::showText(mapToGlobal(tooltip_pt.toPoint()), text_list.join("
"), this, plot_area.toRect()); - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } else { QToolTip::hideText(); } @@ -787,7 +787,7 @@ void ChartView::mouseMoveEvent(QMouseEvent *ev) { if (rubber_rect != rubber->geometry()) { rubber->setGeometry(rubber_rect); } - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } }