From 9ceee909427d2f72ca18d5eeb95ab5c8ba1ed76d Mon Sep 17 00:00:00 2001 From: RumovZ Date: Mon, 17 May 2021 20:07:52 +0200 Subject: [PATCH] Block events when restoring headers Restoring headers after switching states was triggering _on_column_toggled(), leading to unexpected results. --- qt/aqt/browser/table/table.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt/aqt/browser/table/table.py b/qt/aqt/browser/table/table.py index 90570561f..c2293068a 100644 --- a/qt/aqt/browser/table/table.py +++ b/qt/aqt/browser/table/table.py @@ -253,7 +253,9 @@ class Table: saveHeader(self._view.horizontalHeader(), self._state.config_key_prefix) def _restore_header(self) -> None: + self._view.horizontalHeader().blockSignals(True) restoreHeader(self._view.horizontalHeader(), self._state.config_key_prefix) + self._view.horizontalHeader().blockSignals(False) # Setup