Skip to content

Commit 70f8e10

Browse files
committed
fix (remove) NULL index setting in CodeComboboxes
1 parent 385923f commit 70f8e10

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

arho_feature_template/gui/components/code_combobox.py

-5
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ def set_value(self, value: str | None) -> None:
4848
index = self.findData(value)
4949
if index != -1:
5050
self.setCurrentIndex(index)
51-
else:
52-
self.setCurrentIndex(0) # Set selection to NULL if item with `value` was not found
5351

5452

5553
class HierarchicalCodeComboBox(QComboBox):
@@ -120,7 +118,6 @@ def _find_item_recursive(self, item: QTreeWidgetItem, value: str) -> QTreeWidget
120118
def set_value(self, value: str | None) -> None:
121119
# Set selection to NULL if `value` is None
122120
if value is None:
123-
self.setCurrentIndex(self.null_index)
124121
return
125122

126123
# Loop top level tree items
@@ -137,5 +134,3 @@ def set_value(self, value: str | None) -> None:
137134
self.setCurrentIndex(idx.row())
138135
self.setRootModelIndex(self.null_index.parent())
139136
return
140-
141-
self.setCurrentIndex(self.null_index) # Set selection to NULL if item with `value` was not found

0 commit comments

Comments
 (0)