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 eb88cc4 commit 59a5b60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Expand Up @@ -478,7 +478,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 59a5b60

Please sign in to comment.