Skip to content

Commit af4e911

Browse files
committed
[locator] Add active layer scope to the calculator locator filter
This allows the usage of layer scope functions such as sum("MY_FIELD")
1 parent 0e8b90d commit af4e911

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/locator/qgsinbuiltlocatorfilters.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ void QgsExpressionCalculatorLocatorFilter::fetchResults( const QString &string,
478478
{
479479
QgsExpressionContext context;
480480
context << QgsExpressionContextUtils::globalScope()
481-
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );
481+
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() )
482+
<< QgsExpressionContextUtils::layerScope( QgisApp::instance()->activeLayer() );
482483

483484
QString error;
484485
if ( QgsExpression::checkExpression( string, &context, error ) )

0 commit comments

Comments
 (0)