Avoid graphic flickering when changing parameters in StatsPanel
This commit is contained in:
parent
ada23a4092
commit
85338d4b70
|
@ -176,12 +176,10 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT
|
|||
|
||||
if (_chartView)
|
||||
{
|
||||
_vbox2->removeWidget(_chartView);
|
||||
delete _chartView;
|
||||
_plot->removeAllSeries();
|
||||
}
|
||||
|
||||
_plot = new QChart();
|
||||
_plot->createDefaultAxes();
|
||||
else
|
||||
_plot = new QChart();
|
||||
|
||||
if (monthFrom == monthTo && yearFrom == yearTo)
|
||||
{
|
||||
|
@ -301,9 +299,13 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT
|
|||
|
||||
_plot->createDefaultAxes();
|
||||
_plot->setAxisX(axisX, series0);
|
||||
_chartView = new QChartView(_plot);
|
||||
_chartView->setRenderHint(QPainter::Antialiasing);
|
||||
_vbox2->addWidget(_chartView);
|
||||
|
||||
if (!_chartView)
|
||||
{
|
||||
_chartView = new QChartView(_plot);
|
||||
_chartView->setRenderHint(QPainter::Antialiasing);
|
||||
_vbox2->addWidget(_chartView);
|
||||
}
|
||||
|
||||
total = 0.0;
|
||||
for(i=0, categoriesIt = categories.begin(); categoriesIt != categories.end(); categoriesIt++, i++)
|
||||
|
|
Loading…
Reference in New Issue
Block a user