Skip to content

Commit

Permalink
Added vector data importer functionality to auto-select source attrib…
Browse files Browse the repository at this point in the history
…ute if it matches target attribute. (#226)
  • Loading branch information
ldebek authored May 9, 2024
1 parent 81fb1c2 commit e00db26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ History
1.11 (unreleased)
-----------------

- Nothing changed yet.
- Fixes/enhancements: #190


1.10 (2024-04-12)
Expand Down
2 changes: 2 additions & 0 deletions threedi_schematisation_editor/custom_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e00db26

Please sign in to comment.