fix: PanelFactory 信号风暴修复 + 后端上帝类肢解(BaseStepHandler/调度器/Step1打样)

This commit is contained in:
DXC
2026-06-17 17:48:40 +08:00
parent 39e8c29913
commit f6455b71ba
5 changed files with 588 additions and 4 deletions

View File

@ -162,14 +162,19 @@ class PanelFactory:
scroll.setWidget(panel)
scroll.setWidgetResizable(True)
# 替换占位页
# 替换占位页blockSignals 阻断 removeTab/insertTab/setCurrentIndex 触发的
# currentChanged 信号风暴,防止 _on_tab_changed → _ensure_loaded 无限递归)
placeholder = self._placeholders.get(tab_index)
if placeholder is not None and self._tab_widget is not None:
tab_title = self._tab_widget.tabText(tab_index)
tab_icon = self._tab_widget.tabIcon(tab_index)
self._tab_widget.removeTab(tab_index)
self._tab_widget.insertTab(tab_index, scroll, tab_icon, tab_title)
self._tab_widget.setCurrentIndex(tab_index)
self._tab_widget.blockSignals(True)
try:
self._tab_widget.removeTab(tab_index)
self._tab_widget.insertTab(tab_index, scroll, tab_icon, tab_title)
self._tab_widget.setCurrentIndex(tab_index)
finally:
self._tab_widget.blockSignals(False)
# 注册
self._panels[step_id] = panel