Skip to content

Commit

Permalink
Show NULL preview text in expression editor
Browse files Browse the repository at this point in the history
Makes creating/debugging expressions easier for users

(cherry-picked from 1f3723)
  • Loading branch information
nyalldawson committed Jan 11, 2017
1 parent 887383c commit a918290
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4690,6 +4690,10 @@ QString QgsExpression::formatPreviewString( const QVariant& value )
else
return tr( "<i>&lt;geometry: %1&gt;</i>" ).arg( QgsWKBTypes::displayString( geom.geometry()->wkbType() ) );
}
else if ( !value.isValid() )
{
return tr( "<i>NULL</i>" );
}
else if ( value.canConvert< QgsFeature >() )
{
//result is a feature
Expand Down

0 comments on commit a918290

Please sign in to comment.