mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
Add all applicable scopes for editor widget constraint validation
This commit is contained in:
parent
2e9715386d
commit
9626f589fb
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user