Don't calculate unwanted stats for stats dock

This commit is contained in:
Nyall Dawson 2015-06-10 16:04:30 +10:00
parent 7fb4bea279
commit 8f9c73b938

View File

@ -106,10 +106,14 @@ void QgsStatisticalSummaryDockWidget::refreshStatistics()
}
QList< QgsStatisticalSummary::Statistic > statsToDisplay;
QgsStatisticalSummary::Statistics statsToCalc = 0;
foreach ( QgsStatisticalSummary::Statistic stat, mDisplayStats )
{
if ( mStatsActions.value( stat )->isChecked() )
{
statsToDisplay << stat;
statsToCalc |= stat;
}
}
int extraRows = 0;
@ -117,7 +121,7 @@ void QgsStatisticalSummaryDockWidget::refreshStatistics()
extraRows++;
QgsStatisticalSummary stats;
stats.setStatistics( QgsStatisticalSummary::All );
stats.setStatistics( statsToCalc );
stats.calculate( values );
mStatisticsTable->setRowCount( statsToDisplay.count() + extraRows );