Skip to content
Permalink
Browse files

Re-add NULL in "Field and Values" expression

Fixes #37099
  • Loading branch information
elpaso authored and nyalldawson committed Jun 10, 2020
1 parent 13bd846 commit dc7f72997c14989490f54db5cfd92beed00bcfb7
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/gui/qgsexpressiontreeview.cpp
@@ -426,10 +426,14 @@ void QgsExpressionTreeView::loadFieldNames( const QgsFields &fields )

void QgsExpressionTreeView::loadFieldNames()
{
// Cleanup
if ( mExpressionGroups.contains( QStringLiteral( "Fields and Values" ) ) )
{
QgsExpressionItem *node = mExpressionGroups.value( QStringLiteral( "Fields and Values" ) );
node->removeRows( 0, node->rowCount() );
// Re-add NULL
// use -1 as sort order here -- NULL should always show before the field list
registerItem( QStringLiteral( "Fields and Values" ), QStringLiteral( "NULL" ), QStringLiteral( "NULL" ), QString(), QgsExpressionItem::ExpressionNode, false, -1 );
}

// this can happen if fields are manually set

0 comments on commit dc7f729

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