Skip to content
Permalink
Browse files
rebuild statistics drop-down menu only when field type changed
  • Loading branch information
alexbruy committed May 5, 2017
1 parent 68872e5 commit 391cb73ebd936c7345c7a78722cf24ca75945676
Showing with 7 additions and 1 deletion.
  1. +6 −1 src/app/qgsstatisticalsummarydockwidget.cpp
  2. +1 −0 src/app/qgsstatisticalsummarydockwidget.h
@@ -97,6 +97,7 @@ QgsStatisticalSummaryDockWidget::QgsStatisticalSummaryDockWidget( QWidget *paren
mOptionsToolButton->setMenu( mStatisticsMenu );

mFieldType = DataType::Numeric;
mPreviousFieldType = DataType::Numeric;
refreshStatisticsMenu();
}

@@ -120,7 +121,11 @@ void QgsStatisticalSummaryDockWidget::refreshStatistics()
mFieldType = fieldType( mFieldExpressionWidget->currentField() );
}

refreshStatisticsMenu();
if ( mFieldType != mPreviousFieldType )
{
refreshStatisticsMenu();
mPreviousFieldType = mFieldType;
}

bool selectedOnly = mSelectedOnlyCheckBox->isChecked();

@@ -89,6 +89,7 @@ class APP_EXPORT QgsStatisticalSummaryDockWidget : public QgsDockWidget, private

QMenu *mStatisticsMenu = nullptr;
DataType mFieldType;
DataType mPreviousFieldType;
};

#endif // QGSSTATISTICALSUMMARYDOCKWIDGET_H

0 comments on commit 391cb73

Please sign in to comment.