From e00db265c923f73d0f0e8ddc3f6b58e228b5e39e Mon Sep 17 00:00:00 2001 From: Lukasz Debek Date: Thu, 9 May 2024 18:04:09 +0200 Subject: [PATCH] Added vector data importer functionality to auto-select source attribute if it matches target attribute. (#226) --- HISTORY.rst | 2 +- threedi_schematisation_editor/custom_widgets/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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