@@ -529,6 +529,7 @@ void QgsFieldsProperties::attributeTypeDialog()
529529 attributeTypeDialog.setLabelOnTop ( cfg.mLabelOnTop );
530530 attributeTypeDialog.setNotNull ( cfg.mNotNull );
531531 attributeTypeDialog.setExpression ( cfg.mConstraint );
532+ attributeTypeDialog.setExpressionDescription ( cfg.mConstraintDescription );
532533
533534 attributeTypeDialog.setWidgetV2Config ( cfg.mEditorWidgetV2Config );
534535 attributeTypeDialog.setWidgetV2Type ( cfg.mEditorWidgetV2Type );
@@ -539,6 +540,7 @@ void QgsFieldsProperties::attributeTypeDialog()
539540 cfg.mEditable = attributeTypeDialog.fieldEditable ();
540541 cfg.mLabelOnTop = attributeTypeDialog.labelOnTop ();
541542 cfg.mNotNull = attributeTypeDialog.notNull ();
543+ cfg.mConstraintDescription = attributeTypeDialog.expressionDescription ();
542544 cfg.mConstraint = attributeTypeDialog.expression ();
543545
544546 cfg.mEditorWidgetV2Type = attributeTypeDialog.editorWidgetV2Type ();
@@ -913,6 +915,7 @@ void QgsFieldsProperties::apply()
913915 mLayer ->editFormConfig ()->setReadOnly ( i, !cfg.mEditable );
914916 mLayer ->editFormConfig ()->setLabelOnTop ( i, cfg.mLabelOnTop );
915917 mLayer ->editFormConfig ()->setNotNull ( i, cfg.mNotNull );
918+ mLayer ->editFormConfig ()->setExpressionDescription ( i, cfg.mConstraintDescription );
916919 mLayer ->editFormConfig ()->setExpression ( i, cfg.mConstraint );
917920
918921 mLayer ->editFormConfig ()->setWidgetType ( idx, cfg.mEditorWidgetV2Type );
@@ -981,6 +984,7 @@ QgsFieldsProperties::FieldConfig::FieldConfig()
981984 , mEditableEnabled( true )
982985 , mLabelOnTop( false )
983986 , mNotNull( false )
987+ , mConstraintDescription( QString() )
984988 , mButton( nullptr )
985989{
986990}
@@ -994,6 +998,7 @@ QgsFieldsProperties::FieldConfig::FieldConfig( QgsVectorLayer* layer, int idx )
994998 mLabelOnTop = layer->editFormConfig ()->labelOnTop ( idx );
995999 mNotNull = layer->editFormConfig ()->notNull ( idx );
9961000 mConstraint = layer->editFormConfig ()->expression ( idx );
1001+ mConstraintDescription = layer->editFormConfig ()->expressionDescription ( idx );
9971002 mEditorWidgetV2Type = layer->editFormConfig ()->widgetType ( idx );
9981003 mEditorWidgetV2Config = layer->editFormConfig ()->widgetConfig ( idx );
9991004
0 commit comments