diff --git a/HISTORY.rst b/HISTORY.rst index 885bcda..91cecee 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ History 1.11 (unreleased) ----------------- -- Nothing changed yet. +- Fixes/enhancements: #190 1.10 (2024-04-12) diff --git a/threedi_schematisation_editor/custom_widgets/__init__.py b/threedi_schematisation_editor/custom_widgets/__init__.py index f8550d2..dcb1986 100644 --- a/threedi_schematisation_editor/custom_widgets/__init__.py +++ b/threedi_schematisation_editor/custom_widgets/__init__.py @@ -283,6 +283,7 @@ def on_layer_changed(self, layer): for combobox in chain.from_iterable(source_attribute_widgets.values()): combobox.clear() combobox.addItems(layer_field_names) + combobox.setCurrentText(combobox.data_model_field_name) @staticmethod def on_method_changed(source_attribute_combobox, value_map_widget, current_text): @@ -326,6 +327,7 @@ def get_column_widgets(self, column_idx, *data_models): item = tree_view_model.item(row_idx, column_idx) index = item.index() widget = tree_view.indexWidget(index) + widget.data_model_field_name = field_name model_widgets.append(widget) row_idx += 1 column_widgets[model_cls] = model_widgets