From dbf6151d6de74031e12d63fdc8bcd2b8981a5060 Mon Sep 17 00:00:00 2001 From: 27942 <1313123@342> Date: Sat, 31 Jan 2026 23:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AD=A5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui_app.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gui_app.py b/gui_app.py index 8d36eb1..e079d06 100644 --- a/gui_app.py +++ b/gui_app.py @@ -953,6 +953,7 @@ class MainWindow(QMainWindow): # 重新应用筛选和高亮(保持原有的筛选状态) if has_search_filter: + self._suppress_filter_clear_once = True self.filter_table(self.table_search_input.text()) elif has_status_filter: # 重新应用状态筛选(隐藏不匹配的行) @@ -1569,6 +1570,29 @@ class MainWindow(QMainWindow): def filter_table(self, text): """筛选表格行并高亮关键词""" keyword_raw = text.strip() + suppress_clear = getattr(self, "_suppress_filter_clear_once", False) + if suppress_clear: + self._suppress_filter_clear_once = False + # 如果先全选再进行筛选,先清空勾选,避免隐藏行仍保持勾选 + if (not suppress_clear and keyword_raw and hasattr(self, "table_select_all_checkbox") + and self.table_select_all_checkbox.isChecked()): + for config in self.configs: + config['勾选'] = False + self.table_select_all_checkbox.blockSignals(True) + self.table_select_all_checkbox.setChecked(False) + self.table_select_all_checkbox.blockSignals(False) + self._update_checked_count() + self._update_status_statistics() + # 同步当前页勾选框显示 + if not self.use_model_view and hasattr(self, "config_table"): + for row in range(self.config_table.rowCount()): + wrapper = self.config_table.cellWidget(row, 0) + if wrapper: + checkbox = wrapper.findChild(QCheckBox) + if checkbox: + checkbox.blockSignals(True) + checkbox.setChecked(False) + checkbox.blockSignals(False) if self.use_model_view: if not self.table_proxy: return