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 070ca7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
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 070ca7a

Please sign in to comment.