WeChatMsg/main.py
shuaikangzhou 0eca2ce9a2 readme
2023-05-21 00:19:25 +08:00

56 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import sys
from PyQt5.QtWidgets import *
from app.Ui import *
class ViewController:
def __init__(self):
self.viewMainWIn = None
self.viewDecrypt = None
def loadDecryptView(self):
"""
登录界面
:return:
"""
self.viewDecrypt = decrypt.DecryptControl() # 需要将view login设为成员变量
self.viewDecrypt.DecryptSignal.connect(self.loadMainWinView)
self.viewDecrypt.registerSignal.connect(self.loadRegisterView)
self.viewDecrypt.show()
self.viewDecrypt.db_exist()
def loadRegisterView(self):
"""
注册界面
:return:
"""
pass
# self.viewDecrypt = register.registerControl() # 需要将view login设为成员变量
# self.viewDecrypt.DecryptSignal.connect(self.loadDecryptView)
# self.viewDecrypt.show()
def loadMainWinView(self, username):
"""
聊天界面
:param username: 账号
:return:
"""
username = ''
self.viewMainWIn = mainview.MainWinController(username=username)
self.viewMainWIn.setWindowTitle("Chat")
# print(username)
self.viewMainWIn.username = username
# self.viewMainWIn.exitSignal.connect(self.loadDecryptView) # 不需要回到登录界面可以省略
self.viewMainWIn.show()
# self.viewMainWIn.signUp()
if __name__ == '__main__':
app = QApplication(sys.argv)
view = ViewController()
view.loadDecryptView() # 进入登录界面如果view login不是成员变量则离开作用域后失效。
# view.loadMainWinView('102')
sys.exit(app.exec_())