예제 #1
0
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()
예제 #2
0
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()