修复不能正常显示总数的问题

This commit is contained in:
zayac 2024-04-07 21:40:11 +08:00
parent ed5b11fbc8
commit 71c73b39ed

View File

@ -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)