diff --git a/src/charts/chartpresenter.cpp b/src/charts/chartpresenter.cpp index 1676a89..9273a13 100644 --- a/src/charts/chartpresenter.cpp +++ b/src/charts/chartpresenter.cpp @@ -549,7 +549,7 @@ QString ChartPresenter::numberToString(int value) return QString::number(value); } -void ChartPresenter::ensureGLWidget() +void ChartPresenter::updateGLWidget() { #ifndef QT_NO_OPENGL // GLWidget pointer is wrapped in QPointer as its parent is not in our control, and therefore @@ -566,6 +566,9 @@ void ChartPresenter::ensureGLWidget() m_glWidget->show(); } } + // Make sure we update the widget in a timely manner + if (!m_glWidget.isNull()) + m_glWidget->update(); #endif } diff --git a/src/charts/chartpresenter_p.h b/src/charts/chartpresenter_p.h index 2faca11..35df286 100644 --- a/src/charts/chartpresenter_p.h +++ b/src/charts/chartpresenter_p.h @@ -166,7 +166,7 @@ public: QString numberToString(double value, char f = 'g', int prec = 6); QString numberToString(int value); - void ensureGLWidget(); + void updateGLWidget(); void glSetUseWidget(bool enable) { m_glUseWidget = enable; } private: diff --git a/src/charts/xychart/xychart.cpp b/src/charts/xychart/xychart.cpp index cfe0753..718bc35 100644 --- a/src/charts/xychart/xychart.cpp +++ b/src/charts/xychart/xychart.cpp @@ -113,8 +113,8 @@ void XYChart::updateChart(QVector &oldPoints, QVector &newPoin void XYChart::updateGlChart() { - presenter()->ensureGLWidget(); dataSet()->glXYSeriesDataManager()->setPoints(m_series, domain()); + presenter()->updateGLWidget(); updateGeometry(); }