Skip to content

Commit 070ca7a

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 4ffed0f commit 070ca7a

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
@@ -448,7 +448,8 @@ void QgsExpressionCalculatorLocatorFilter::fetchResults( const QString &string,
448448
{
449449
QgsExpressionContext context;
450450
context << QgsExpressionContextUtils::globalScope()
451-
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() );
451+
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() )
452+
<< QgsExpressionContextUtils::layerScope( QgisApp::instance()->activeLayer() );
452453

453454
QString error;
454455
if ( QgsExpression::checkExpression( string, &context, error ) )

0 commit comments

Comments
 (0)