Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't calculate unwanted stats for stats dock
  • Loading branch information
nyalldawson committed Jun 10, 2015
1 parent 7fb4bea commit 8f9c73b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsstatisticalsummarydockwidget.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 8f9c73b

Please sign in to comment.