Skip to content
Permalink
Browse files
Don't calculate unwanted stats for stats dock
  • Loading branch information
nyalldawson committed Jun 10, 2015
1 parent 7fb4bea commit 8f9c73b938991793bec5d0719c9380a6c583f17b
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/app/qgsstatisticalsummarydockwidget.cpp
@@ -106,18 +106,22 @@ 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;
if ( mStatsActions.value( MISSING_VALUES )->isChecked() )
extraRows++;

QgsStatisticalSummary stats;
stats.setStatistics( QgsStatisticalSummary::All );
stats.setStatistics( statsToCalc );
stats.calculate( values );

mStatisticsTable->setRowCount( statsToDisplay.count() + extraRows );

0 comments on commit 8f9c73b

Please sign in to comment.