@@ -528,6 +528,7 @@ void QgsFieldsProperties::attributeTypeDialog()
528528 attributeTypeDialog.setFieldEditable ( cfg.mEditable );
529529 attributeTypeDialog.setLabelOnTop ( cfg.mLabelOnTop );
530530 attributeTypeDialog.setNotNull ( cfg.mNotNull );
531+ attributeTypeDialog.setConstraint ( cfg.mConstraint );
531532
532533 attributeTypeDialog.setWidgetV2Config ( cfg.mEditorWidgetV2Config );
533534 attributeTypeDialog.setWidgetV2Type ( cfg.mEditorWidgetV2Type );
@@ -538,6 +539,7 @@ void QgsFieldsProperties::attributeTypeDialog()
538539 cfg.mEditable = attributeTypeDialog.fieldEditable ();
539540 cfg.mLabelOnTop = attributeTypeDialog.labelOnTop ();
540541 cfg.mNotNull = attributeTypeDialog.notNull ();
542+ cfg.mConstraint = attributeTypeDialog.constraint ();
541543
542544 cfg.mEditorWidgetV2Type = attributeTypeDialog.editorWidgetV2Type ();
543545 cfg.mEditorWidgetV2Config = attributeTypeDialog.editorWidgetV2Config ();
@@ -911,6 +913,7 @@ void QgsFieldsProperties::apply()
911913 mLayer ->editFormConfig ()->setReadOnly ( i, !cfg.mEditable );
912914 mLayer ->editFormConfig ()->setLabelOnTop ( i, cfg.mLabelOnTop );
913915 mLayer ->editFormConfig ()->setNotNull ( i, cfg.mNotNull );
916+ mLayer ->editFormConfig ()->setConstraint ( i, cfg.mConstraint );
914917
915918 mLayer ->editFormConfig ()->setWidgetType ( idx, cfg.mEditorWidgetV2Type );
916919 mLayer ->editFormConfig ()->setWidgetConfig ( idx, cfg.mEditorWidgetV2Config );
@@ -990,6 +993,7 @@ QgsFieldsProperties::FieldConfig::FieldConfig( QgsVectorLayer* layer, int idx )
990993 && layer->fields ().fieldOrigin ( idx ) != QgsFields::OriginExpression;
991994 mLabelOnTop = layer->editFormConfig ()->labelOnTop ( idx );
992995 mNotNull = layer->editFormConfig ()->notNull ( idx );
996+ mConstraint = layer->editFormConfig ()->constraint ( idx );
993997 mEditorWidgetV2Type = layer->editFormConfig ()->widgetType ( idx );
994998 mEditorWidgetV2Config = layer->editFormConfig ()->widgetConfig ( idx );
995999
0 commit comments