@@ -557,7 +557,7 QString ChartPresenter::numberToString(int value) | |||
|
557 | 557 | return QString::number(value); |
|
558 | 558 | } |
|
559 | 559 | |
|
560 |
void ChartPresenter:: |
|
|
560 | void ChartPresenter::updateGLWidget() | |
|
561 | 561 | { |
|
562 | 562 | #ifndef QT_NO_OPENGL |
|
563 | 563 | // GLWidget pointer is wrapped in QPointer as its parent is not in our control, and therefore |
@@ -574,6 +574,9 void ChartPresenter::ensureGLWidget() | |||
|
574 | 574 | m_glWidget->show(); |
|
575 | 575 | } |
|
576 | 576 | } |
|
577 | // Make sure we update the widget in a timely manner | |
|
578 | if (!m_glWidget.isNull()) | |
|
579 | m_glWidget->update(); | |
|
577 | 580 | #endif |
|
578 | 581 | } |
|
579 | 582 |
@@ -174,7 +174,7 public: | |||
|
174 | 174 | QString numberToString(double value, char f = 'g', int prec = 6); |
|
175 | 175 | QString numberToString(int value); |
|
176 | 176 | |
|
177 |
void |
|
|
177 | void updateGLWidget(); | |
|
178 | 178 | void glSetUseWidget(bool enable) { m_glUseWidget = enable; } |
|
179 | 179 | |
|
180 | 180 | private: |
@@ -121,8 +121,8 void XYChart::updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoin | |||
|
121 | 121 | |
|
122 | 122 | void XYChart::updateGlChart() |
|
123 | 123 | { |
|
124 | presenter()->ensureGLWidget(); | |
|
125 | 124 | dataSet()->glXYSeriesDataManager()->setPoints(m_series, domain()); |
|
125 | presenter()->updateGLWidget(); | |
|
126 | 126 | updateGeometry(); |
|
127 | 127 | } |
|
128 | 128 |
@@ -598,7 +598,9 void DeclarativeChart::renderScene() | |||
|
598 | 598 | QSize chartSize = m_chart->size().toSize(); |
|
599 | 599 | if (!m_sceneImage || chartSize != m_sceneImage->size()) { |
|
600 | 600 | delete m_sceneImage; |
|
601 | m_sceneImage = new QImage(chartSize, QImage::Format_ARGB32); | |
|
601 | qreal dpr = window() ? window()->devicePixelRatio() : 1.0; | |
|
602 | m_sceneImage = new QImage(chartSize * dpr, QImage::Format_ARGB32); | |
|
603 | m_sceneImage->setDevicePixelRatio(dpr); | |
|
602 | 604 | m_sceneImageNeedsClear = true; |
|
603 | 605 | } |
|
604 | 606 |
General Comments 0
You need to be logged in to leave comments.
Login now