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 1eb3bfc commit cfc3a86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/qgsexpression.cpp
Expand Up @@ -5207,6 +5207,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 cfc3a86

Please sign in to comment.