修复启动加载慢的问题#59

This commit is contained in:
shuaikangzhou 2023-12-05 20:17:53 +08:00
parent d7604bf87d
commit 6b1c866e44
2 changed files with 6 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class ChatInfo(QWidget):
self.show_chat_thread = ShowChatThread(self.contact) self.show_chat_thread = ShowChatThread(self.contact)
self.show_chat_thread.showSingal.connect(self.add_message) self.show_chat_thread.showSingal.connect(self.add_message)
self.show_chat_thread.finishSingal.connect(self.show_finish) self.show_chat_thread.finishSingal.connect(self.show_finish)
self.show_chat_thread.start() # self.show_chat_thread.start()
def show_finish(self, ok): def show_finish(self, ok):
self.setScrollBarPos() self.setScrollBarPos()

View File

@ -58,6 +58,7 @@ class ChatWindow(QWidget, Ui_Form):
self.contacts = [[], []] self.contacts = [[], []]
self.init_ui() self.init_ui()
self.show_chats() self.show_chats()
self.visited = set()
def init_ui(self): def init_ui(self):
search_action = QAction(self.lineEdit) search_action = QAction(self.lineEdit)
@ -112,6 +113,10 @@ class ChatWindow(QWidget, Ui_Form):
def setCurrentIndex(self, row): def setCurrentIndex(self, row):
# print(row) # print(row)
self.stackedWidget.setCurrentIndex(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): def stop_loading(self, a0):
# self.label.setVisible(False) # self.label.setVisible(False)