Skip to content
Permalink
Browse files

Highlight @zoom_level variable when present

  • Loading branch information
nyalldawson committed Sep 9, 2020
1 parent 5df98cf commit 8abcf10fb024c1e09b46cb3e762171a9d20af37d
Showing with 14 additions and 5 deletions.
  1. +14 −5 src/gui/symbology/qgssymbollayerwidget.cpp
@@ -93,11 +93,20 @@ QgsExpressionContext QgsSymbolLayerWidget::createExpressionContext() const
//TODO - show actual value
expContext.setOriginalValueVariable( QVariant() );

expContext.setHighlightedVariables( QStringList() << QgsExpressionContext::EXPR_ORIGINAL_VALUE << QgsExpressionContext::EXPR_SYMBOL_COLOR
<< QgsExpressionContext::EXPR_GEOMETRY_PART_COUNT << QgsExpressionContext::EXPR_GEOMETRY_PART_NUM
<< QgsExpressionContext::EXPR_GEOMETRY_POINT_COUNT << QgsExpressionContext::EXPR_GEOMETRY_POINT_NUM
<< QgsExpressionContext::EXPR_CLUSTER_COLOR << QgsExpressionContext::EXPR_CLUSTER_SIZE
<< QStringLiteral( "symbol_layer_count" ) << QStringLiteral( "symbol_layer_index" ) );
QStringList highlights;
highlights << QgsExpressionContext::EXPR_ORIGINAL_VALUE << QgsExpressionContext::EXPR_SYMBOL_COLOR
<< QgsExpressionContext::EXPR_GEOMETRY_PART_COUNT << QgsExpressionContext::EXPR_GEOMETRY_PART_NUM
<< QgsExpressionContext::EXPR_GEOMETRY_POINT_COUNT << QgsExpressionContext::EXPR_GEOMETRY_POINT_NUM
<< QgsExpressionContext::EXPR_CLUSTER_COLOR << QgsExpressionContext::EXPR_CLUSTER_SIZE
<< QStringLiteral( "symbol_layer_count" ) << QStringLiteral( "symbol_layer_index" );


if ( expContext.hasVariable( QStringLiteral( "zoom_level" ) ) )
{
highlights << QStringLiteral( "zoom_level" );
}

expContext.setHighlightedVariables( highlights );

return expContext;
}

0 comments on commit 8abcf10

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