Skip to content
Permalink
Browse files
Add all applicable scopes for editor widget constraint validation
  • Loading branch information
m-kuhn committed Sep 9, 2016
1 parent 2e97153 commit 9626f589fb9a4070e2a2c149a855dd1fc4312a8d
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp
@@ -117,11 +117,9 @@ void QgsEditorWidgetWrapper::updateConstraint( const QgsFeature &ft )
{
description = layer()->editFormConfig().expressionDescription( mFieldIdx );

QgsExpressionContext context =
QgsExpressionContextUtils::createFeatureBasedContext( ft, ft.fields() );
context << QgsExpressionContextUtils::layerScope( layer() );

QgsExpressionContext context = layer()->createExpressionContext();
context.setFeature( ft );

QgsExpression expr( expression );

mValidConstraint = expr.evaluate( &context ).toBool();

0 comments on commit 9626f58

Please sign in to comment.