set feature when starting action on attribute edit form

This commit is contained in:
David 2017-11-01 15:55:32 +01:00 committed by Matthias Kuhn
parent 5ffbb359d0
commit 1ffc3fd190

View File

@ -89,6 +89,7 @@ void QgsActionMenu::triggerAction()
{
// define custom substitutions: layer id and clicked coords
QgsExpressionContext context = mLayer->createExpressionContext();
context.setFeature( mFeature );
QgsExpressionContextScope *actionScope = new QgsExpressionContextScope();
actionScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "action_scope" ), mActionScope, true ) );