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)
|
if (_chartView)
|
||||||
{
|
{
|
||||||
_vbox2->removeWidget(_chartView);
|
_plot->removeAllSeries();
|
||||||
delete _chartView;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
_plot = new QChart();
|
_plot = new QChart();
|
||||||
_plot->createDefaultAxes();
|
|
||||||
|
|
||||||
if (monthFrom == monthTo && yearFrom == yearTo)
|
if (monthFrom == monthTo && yearFrom == yearTo)
|
||||||
{
|
{
|
||||||
|
@ -301,9 +299,13 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT
|
||||||
|
|
||||||
_plot->createDefaultAxes();
|
_plot->createDefaultAxes();
|
||||||
_plot->setAxisX(axisX, series0);
|
_plot->setAxisX(axisX, series0);
|
||||||
|
|
||||||
|
if (!_chartView)
|
||||||
|
{
|
||||||
_chartView = new QChartView(_plot);
|
_chartView = new QChartView(_plot);
|
||||||
_chartView->setRenderHint(QPainter::Antialiasing);
|
_chartView->setRenderHint(QPainter::Antialiasing);
|
||||||
_vbox2->addWidget(_chartView);
|
_vbox2->addWidget(_chartView);
|
||||||
|
}
|
||||||
|
|
||||||
total = 0.0;
|
total = 0.0;
|
||||||
for(i=0, categoriesIt = categories.begin(); categoriesIt != categories.end(); categoriesIt++, i++)
|
for(i=0, categoriesIt = categories.begin(); categoriesIt != categories.end(); categoriesIt++, i++)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user