Skip to content

Commit 9626f58

Browse files
committedSep 9, 2016
Add all applicable scopes for editor widget constraint validation
1 parent 2e97153 commit 9626f58

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ void QgsEditorWidgetWrapper::updateConstraint( const QgsFeature &ft )
117117
{
118118
description = layer()->editFormConfig().expressionDescription( mFieldIdx );
119119

120-
QgsExpressionContext context =
121-
QgsExpressionContextUtils::createFeatureBasedContext( ft, ft.fields() );
122-
context << QgsExpressionContextUtils::layerScope( layer() );
123-
120+
QgsExpressionContext context = layer()->createExpressionContext();
124121
context.setFeature( ft );
122+
125123
QgsExpression expr( expression );
126124

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

0 commit comments

Comments
 (0)
Please sign in to comment.