From 6b1c866e44314e6ccd76004632c9e9ca94bb46ca Mon Sep 17 00:00:00 2001 From: shuaikangzhou <863909694@qq.com> Date: Tue, 5 Dec 2023 20:17:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=85=A2=E7=9A=84=E9=97=AE=E9=A2=98#59?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ui_pc/chat/chat_info.py | 2 +- app/ui_pc/chat/chat_window.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/ui_pc/chat/chat_info.py b/app/ui_pc/chat/chat_info.py index 3df71d3..9e8e36a 100644 --- a/app/ui_pc/chat/chat_info.py +++ b/app/ui_pc/chat/chat_info.py @@ -39,7 +39,7 @@ class ChatInfo(QWidget): self.show_chat_thread = ShowChatThread(self.contact) self.show_chat_thread.showSingal.connect(self.add_message) self.show_chat_thread.finishSingal.connect(self.show_finish) - self.show_chat_thread.start() + # self.show_chat_thread.start() def show_finish(self, ok): self.setScrollBarPos() diff --git a/app/ui_pc/chat/chat_window.py b/app/ui_pc/chat/chat_window.py index e5a6ba1..a0cf7cd 100644 --- a/app/ui_pc/chat/chat_window.py +++ b/app/ui_pc/chat/chat_window.py @@ -58,6 +58,7 @@ class ChatWindow(QWidget, Ui_Form): self.contacts = [[], []] self.init_ui() self.show_chats() + self.visited = set() def init_ui(self): search_action = QAction(self.lineEdit) @@ -112,6 +113,10 @@ class ChatWindow(QWidget, Ui_Form): def setCurrentIndex(self, row): # print(row) self.stackedWidget.setCurrentIndex(row) + if row not in self.visited: + chat_info_window = self.stackedWidget.currentWidget() + chat_info_window.update_history_messages() + self.visited.add(row) def stop_loading(self, a0): # self.label.setVisible(False)