Skip to content
Permalink
Browse files

[expression builder] clear fields values when changing field (#8703)

  • Loading branch information
3nids committed Dec 19, 2018
1 parent 0f037da commit a753f8b0ddaf329c17597cb952965ac3f077d4aa
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/gui/qgsexpressionbuilderwidget.cpp
@@ -235,13 +235,19 @@ void QgsExpressionBuilderWidget::currentChanged( const QModelIndex &index, const
if ( !item )
return;

if ( item->getItemType() == QgsExpressionItem::Field && mFieldValues.contains( item->text() ) )
bool isField = mLayer && item->getItemType() == QgsExpressionItem::Field;
if ( isField )
{
const QStringList &values = mFieldValues[item->text()];
mValuesModel->setStringList( values );
if ( mFieldValues.contains( item->text() ) )
{
const QStringList &values = mFieldValues[item->text()];
mValuesModel->setStringList( values );
}
else
{
mValuesModel->setStringList( QStringList() );
}
}

bool isField = mLayer && item->getItemType() == QgsExpressionItem::Field;
mValueGroupBox->setVisible( isField );
mShowHelpButton->setText( isField ? tr( "Show Values" ) : tr( "Show Help" ) );

0 comments on commit a753f8b

Please sign in to comment.
You can’t perform that action at this time.