@@ -935,19 +935,21 @@ void QgsFieldsProperties::apply()
935
935
{
936
936
QSet<QString> excludeAttributesWMS, excludeAttributesWFS;
937
937
938
+ QgsEditFormConfig editFormConfig = mLayer ->editFormConfig ();
939
+
938
940
for ( int i = 0 ; i < mFieldsList ->rowCount (); i++ )
939
941
{
940
942
int idx = mFieldsList ->item ( i, attrIdCol )->text ().toInt ();
941
943
FieldConfig cfg = configForRow ( i );
942
944
943
- mLayer -> editFormConfig () .setReadOnly ( i, !cfg.mEditable );
944
- mLayer -> editFormConfig () .setLabelOnTop ( i, cfg.mLabelOnTop );
945
- mLayer -> editFormConfig () .setNotNull ( i, cfg.mNotNull );
946
- mLayer -> editFormConfig () .setExpressionDescription ( i, cfg.mConstraintDescription );
947
- mLayer -> editFormConfig () .setExpression ( i, cfg.mConstraint );
945
+ editFormConfig.setReadOnly ( i, !cfg.mEditable );
946
+ editFormConfig.setLabelOnTop ( i, cfg.mLabelOnTop );
947
+ editFormConfig.setNotNull ( i, cfg.mNotNull );
948
+ editFormConfig.setExpressionDescription ( i, cfg.mConstraintDescription );
949
+ editFormConfig.setExpression ( i, cfg.mConstraint );
948
950
949
- mLayer -> editFormConfig () .setWidgetType ( idx, cfg.mEditorWidgetType );
950
- mLayer -> editFormConfig () .setWidgetConfig ( idx, cfg.mEditorWidgetConfig );
951
+ editFormConfig.setWidgetType ( idx, cfg.mEditorWidgetType );
952
+ editFormConfig.setWidgetConfig ( idx, cfg.mEditorWidgetConfig );
951
953
952
954
if ( mFieldsList ->item ( i, attrWMSCol )->checkState () == Qt::Unchecked )
953
955
{
@@ -960,7 +962,6 @@ void QgsFieldsProperties::apply()
960
962
}
961
963
962
964
// tabs and groups
963
- QgsEditFormConfig editFormConfig = mLayer ->editFormConfig ();
964
965
editFormConfig.clearTabs ();
965
966
for ( int t = 0 ; t < mDesignerTree ->invisibleRootItem ()->childCount (); t++ )
966
967
{
@@ -969,9 +970,8 @@ void QgsFieldsProperties::apply()
969
970
editFormConfig.addTab ( createAttributeEditorWidget ( tabItem, nullptr , false ) );
970
971
}
971
972
973
+ editFormConfig.setUiForm ( mEditFormLineEdit ->text () );
972
974
editFormConfig.setLayout (( QgsEditFormConfig::EditorLayout ) mEditorLayoutComboBox ->currentIndex () );
973
- if ( mEditorLayoutComboBox ->currentIndex () == QgsEditFormConfig::UiFileLayout )
974
- editFormConfig.setUiForm ( mEditFormLineEdit ->text () );
975
975
976
976
// Init function configuration
977
977
editFormConfig.setInitFunction ( mInitFunctionLineEdit ->text () );
0 commit comments