From 71c73b39ed8d3d984482d20e7b79cde2eeb61796 Mon Sep 17 00:00:00 2001 From: zayac Date: Sun, 7 Apr 2024 21:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E6=98=BE=E7=A4=BA=E6=80=BB=E6=95=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/app.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ui/app.py b/src/ui/app.py index 8375843..314e8dc 100644 --- a/src/ui/app.py +++ b/src/ui/app.py @@ -337,13 +337,10 @@ class Application(QMainWindow): old_data = convert_data(old_data_str) new_data = convert_data(new_data) if old_data != new_data: - self.handle_data_change(table, col, new_data - old_data, account_username, notifications) - - def handle_data_change(self, table, col, count_change, account_username, notifications): - """处理表格数据变更,更新单元格颜色,并生成通知""" - self.update_cell_color(table, table.rowCount() - 1, col, count_change) - self.generate_notifications(account_username, col, col, count_change, notifications) - + count_change = new_data - old_data + self.update_cell_color(table, row, col, count_change) + # 确保传递 cell_data 和 count_change 参数 + self.generate_notifications(account_username, col, new_data, count_change, notifications) def update_cell_color(self, table, row, col, count_change): """更新单元格颜色""" cell = table.item(row, col)