@@ -527,6 +527,7 @@ void QgsFieldsProperties::attributeTypeDialog()
527
527
528
528
attributeTypeDialog.setFieldEditable ( cfg.mEditable );
529
529
attributeTypeDialog.setLabelOnTop ( cfg.mLabelOnTop );
530
+ attributeTypeDialog.setNotNull ( cfg.mNotNull );
530
531
531
532
attributeTypeDialog.setWidgetV2Config ( cfg.mEditorWidgetV2Config );
532
533
attributeTypeDialog.setWidgetV2Type ( cfg.mEditorWidgetV2Type );
@@ -536,6 +537,7 @@ void QgsFieldsProperties::attributeTypeDialog()
536
537
537
538
cfg.mEditable = attributeTypeDialog.fieldEditable ();
538
539
cfg.mLabelOnTop = attributeTypeDialog.labelOnTop ();
540
+ cfg.mNotNull = attributeTypeDialog.notNull ();
539
541
540
542
cfg.mEditorWidgetV2Type = attributeTypeDialog.editorWidgetV2Type ();
541
543
cfg.mEditorWidgetV2Config = attributeTypeDialog.editorWidgetV2Config ();
@@ -908,6 +910,7 @@ void QgsFieldsProperties::apply()
908
910
909
911
mLayer ->editFormConfig ()->setReadOnly ( i, !cfg.mEditable );
910
912
mLayer ->editFormConfig ()->setLabelOnTop ( i, cfg.mLabelOnTop );
913
+ mLayer ->editFormConfig ()->setNotNull ( i, cfg.mNotNull );
911
914
912
915
mLayer ->editFormConfig ()->setWidgetType ( idx, cfg.mEditorWidgetV2Type );
913
916
mLayer ->editFormConfig ()->setWidgetConfig ( idx, cfg.mEditorWidgetV2Config );
@@ -974,6 +977,7 @@ QgsFieldsProperties::FieldConfig::FieldConfig()
974
977
: mEditable( true )
975
978
, mEditableEnabled( true )
976
979
, mLabelOnTop( false )
980
+ , mNotNull( false )
977
981
, mButton( nullptr )
978
982
{
979
983
}
@@ -985,6 +989,7 @@ QgsFieldsProperties::FieldConfig::FieldConfig( QgsVectorLayer* layer, int idx )
985
989
mEditableEnabled = layer->fields ().fieldOrigin ( idx ) != QgsFields::OriginJoin
986
990
&& layer->fields ().fieldOrigin ( idx ) != QgsFields::OriginExpression;
987
991
mLabelOnTop = layer->editFormConfig ()->labelOnTop ( idx );
992
+ mNotNull = layer->editFormConfig ()->notNull ( idx );
988
993
mEditorWidgetV2Type = layer->editFormConfig ()->widgetType ( idx );
989
994
mEditorWidgetV2Config = layer->editFormConfig ()->widgetConfig ( idx );
990
995
0 commit comments