Skip to content

Commit 5a629aa

Browse files
committed
fix(qt): restore fill_combo_values signal blocking
1 parent ff915ee commit 5a629aa

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

tools_qt.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -656,26 +656,26 @@ def fill_combo_values( # noqa: C901
656656
elem.append(row[x])
657657
records.append(elem)
658658

659-
combo.blockSignals(True)
660-
if combo_clear:
661-
combo.clear()
662-
records_sorted = records
663-
659+
signals_blocked = combo.blockSignals(True)
664660
try:
665-
if sort_combo:
666-
records_sorted = sorted(records, key=operator.itemgetter(sort_by))
667-
except Exception:
668-
pass
669-
finally:
661+
if combo_clear:
662+
combo.clear()
663+
records_sorted = records
664+
try:
665+
if sort_combo:
666+
records_sorted = sorted(records, key=operator.itemgetter(sort_by))
667+
except Exception:
668+
pass
670669
if add_empty:
671670
records_sorted.insert(0, ["", ""])
672671

673672
for record in records_sorted:
674673
combo.addItem(str(record[index_to_show]), record)
675-
combo.blockSignals(False)
676674

677-
if None not in (selected_id, index_to_compare):
678-
set_combo_value(combo, selected_id, index_to_compare)
675+
if None not in (selected_id, index_to_compare):
676+
set_combo_value(combo, selected_id, index_to_compare)
677+
finally:
678+
combo.blockSignals(signals_blocked)
679679

680680

681681
def set_combo_item_unselectable_by_id(qcombo, list_id=None):

0 commit comments

Comments
 (0)