From 8f9c73b938991793bec5d0719c9380a6c583f17b Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 10 Jun 2015 16:04:30 +1000 Subject: [PATCH] Don't calculate unwanted stats for stats dock --- src/app/qgsstatisticalsummarydockwidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/qgsstatisticalsummarydockwidget.cpp b/src/app/qgsstatisticalsummarydockwidget.cpp index 6e56967e64c..70cfe6fb4f1 100644 --- a/src/app/qgsstatisticalsummarydockwidget.cpp +++ b/src/app/qgsstatisticalsummarydockwidget.cpp @@ -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 );