Skip to content
Permalink
Browse files

[locator] Add active layer scope to the calculator locator filter

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 59a5b60980957cf8417fee9366591709b92221c0
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/locator/qgsinbuiltlocatorfilters.cpp
@@ -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 ) )

0 comments on commit 59a5b60

Please sign in to comment.
You can’t perform that action at this time.