Skip to content

Commit

Permalink
[locator] Add active layer scope to the calculator locator filter
Browse files Browse the repository at this point in the history
This allows the usage of layer scope functions such as
sum("MY_FIELD")
  • Loading branch information
nirvn committed Apr 5, 2019
1 parent 4ffed0f commit dc6cc08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ void QgsExpressionCalculatorLocatorFilter::fetchResults( const QString &string,
{
QgsExpressionContext context;
context << QgsExpressionContextUtils::globalScope()
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() )
<< QgsExpressionContextUtils::layerScope( QgisApp::instance()->activeLayer() );

QString error;
if ( QgsExpression::checkExpression( string, &context, error ) )
Expand Down

0 comments on commit dc6cc08

Please sign in to comment.