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 498d51e commit 565d999ad259a019b418d17ad18df4a2d01f18bd
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/gui/qgsexpressionbuilderwidget.cpp
@@ -234,13 +234,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 565d999

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