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 9626f58
Showing 1 changed file with 2 additions and 4 deletions.
@@ -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.