From a559d511f93b7f2db84ff283f1b1b642dd541241 Mon Sep 17 00:00:00 2001 From: Allan Bazinet Date: Thu, 31 Oct 2024 06:26:44 -0700 Subject: [PATCH] Use scoped value for replot --- plotter.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plotter.cpp b/plotter.cpp index 98c178e0..96e382a1 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -185,7 +185,7 @@ CPlotter::draw(float swide[], { // Move current data down one line (must do this before attaching a QPainter object) - if(bScroll && !m_replot) + if (bScroll && !m_replot) { m_WaterfallPixmap.scroll(0, 1, m_WaterfallPixmap.rect()); } @@ -205,7 +205,7 @@ CPlotter::draw(float swide[], if(swide[0] > 1.e29 && swide[0] < 1.5e30) painter1.setPen(Qt::green); // horizontal line if(swide[0] > 1.4e30 ) painter1.setPen(Qt::yellow); - if(!m_replot) + if (!m_replot) { m_j = 0; int irow = -1; @@ -338,7 +338,7 @@ CPlotter::replot() resizeEvent(nullptr); float swide[m_w]; - m_replot = true; + QScopedValueRollback scoped(m_replot, true); for (int irow = 0; irow < m_h1; irow++) { @@ -348,8 +348,6 @@ CPlotter::replot() } update(); - - m_replot = false; } void