Skip to content

Commit dc7f729

Browse files
elpasonyalldawson
authored andcommittedJun 10, 2020
Re-add NULL in "Field and Values" expression
Fixes #37099
1 parent 13bd846 commit dc7f729

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/gui/qgsexpressiontreeview.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,14 @@ void QgsExpressionTreeView::loadFieldNames( const QgsFields &fields )
426426

427427
void QgsExpressionTreeView::loadFieldNames()
428428
{
429+
// Cleanup
429430
if ( mExpressionGroups.contains( QStringLiteral( "Fields and Values" ) ) )
430431
{
431432
QgsExpressionItem *node = mExpressionGroups.value( QStringLiteral( "Fields and Values" ) );
432433
node->removeRows( 0, node->rowCount() );
434+
// Re-add NULL
435+
// use -1 as sort order here -- NULL should always show before the field list
436+
registerItem( QStringLiteral( "Fields and Values" ), QStringLiteral( "NULL" ), QStringLiteral( "NULL" ), QString(), QgsExpressionItem::ExpressionNode, false, -1 );
433437
}
434438

435439
// this can happen if fields are manually set

0 commit comments

Comments
 (0)
Please sign in to comment.