class WebChatApp(QObject): """ 负责组合登录界面,聊天界面,微信访问模块,形成微信聊天的功能 """ def __init__(self): super().__init__() # 调用辅助类实现登录 self.chat = WebChatHelper() self.ui_login = DlgQRLogin(self.chat) self.ui_login.show() self.ui_main = WidChatMain(self.chat) # self.ui_main.show() self.chat.sign_login_ok.connect(self.show_chat_main) self.chat.start() # 辅助类开始工作 def show_chat_main(self): # 隐藏登录 self.ui_login.hide() # 释放登录 self.ui_login.destroy() # 加载用户列表 self.ui_main.show_user_list() # 显示聊天窗体 self.ui_main.show()
def __init__(self): super().__init__() # 调用辅助类实现登录 self.chat = WebChatHelper() self.ui_login = DlgQRLogin(self.chat) # 构建登录对象 self.ui_login.show() # 显示登录对象 self.ui_main = WidChatMain(self.chat) # 构建聊天窗体对象 self.chat.sign_login_ok.connect(self.show_chat_main) self.chat.start() # start是开始线程排队,挨个run每个线程
def __init__(self): super().__init__() self.chat = WebChatHelper() self.ui_login = DlgQRLogin(self.chat) self.ui_login.show() self.ui_main = WidChatMain(self.chat) # self.ui_main.show() self.chat.start() self.chat.sign_login_ok.connect(self.show_chat_main) self.chat.sign_login_fail.connect(self.show_error)
def __init__(self): super().__init__() # 调用辅助类实现登录 self.chat = WebChatHelper() self.ui_login = DlgQRLogin(self.chat) # 调用窗体构成 传给ui_login self.ui_login.show() # show 显示窗体 self.ui_main = WidChatMain(self.chat) # self.ui_main.show() self.chat.sign_login_ok.connect(self.show_chat_main) self.chat.start() # 启动多线程 辅助类开始工作
class WebChatApp(QObject): def __init__(self): super().__init__() self.chat = WebChatHelper() self.ui_login = DlgQRLogin(self.chat) self.ui_login.show() self.ui_main = WidChatMain(self.chat) # self.ui_main.show() self.chat.start() self.chat.sign_login_ok.connect(self.show_chat_main) self.chat.sign_login_fail.connect(self.show_error) def show_chat_main(self): self.ui_login.hide() self.ui_login.destroy() self.ui_main.show_user_list() self.ui_main.show_mp_list() self.ui_main.setWindowFlags(Qt.FramelessWindowHint) self.ui_main.show() def show_error(self): self.ui_login.error()