From 68e002ba8e54fdcb5545663459232a2473031543 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Tue, 17 Mar 2026 15:27:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(ALTimerTaskManageWidget):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=88=A0=E9=99=A4=E4=BB=BB=E5=8A=A1=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E6=A7=BD=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复删除任务的信号槽参数传递问题,此次修复通过 lambda 表达式将当前的 task 作为参数传递,避免了闭包陷阱。 --- src/gui/ALTimerTaskManageWidget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/ALTimerTaskManageWidget.py b/src/gui/ALTimerTaskManageWidget.py index a5536d9..3fa2b65 100644 --- a/src/gui/ALTimerTaskManageWidget.py +++ b/src/gui/ALTimerTaskManageWidget.py @@ -357,7 +357,7 @@ class ALTimerTaskManageWidget(QWidget, Ui_ALTimerTaskManageWidget): item.setData(Qt.UserRole, timer_task) widget = ALTimerTaskItemWidget(self, timer_task) widget.DeleteButton.clicked.connect( - lambda _, task = timer_task: self.deleteTask(timer_task) + lambda _, task = timer_task: self.deleteTask(task) ) if timer_task.get("repeat", False) and hasattr(widget, "HistoryButton"): widget.HistoryButton.clicked.connect(