The Problem
I'm using a Qt LineChart, this QLineChart can load and remove data without a problem on CPU rendering. However, QChart removeSeries() does not update my QLineChart properly when using setUseOpenGL(true). The removed data is still visible on the QChart. Strangely, when hovering the mouse over the QChart, the QChart is updated and data is removed.
Expected Result
Update QChart after calling removeSeries().
Observed Result
QChart is not updated.
What I've tried
- Call ChartView repaint() -- no effect
- Emit custom QEvent to simulate mouse hover over QChart -- no effect
- Set Widget which contains QChartView to FullViewportUpdate -- no effect
I'm all out of ideas. All suggestions are welcome. Relevant code:
QLineSeries *series3= data->getScanLineSeries();
series3->setUseOpenGL(true);
if(data->getLineSeriesOnChart() == false)
...
{
chart->addSeries(series3);
data->setLineSeriesOnChart(true);
std::cout << "Series added to chart.";
qDebug() << QString("Series added to chart");
}
else
{
chart->removeSeries(series3);
data->setLineSeriesOnChart(false);
qDebug() << QString("ERROR: this series was already on the chart, removing QLineSeries");
return chart;
}
...
(axes handling)
return chart;