Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dc6cc08

Browse files
committedApr 5, 2019
[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 dc6cc08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/app/locator/qgsinbuiltlocatorfilters.cpp

Lines changed: 2 additions & 1 deletion
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)
Please sign in to comment.