注册界面对外接口
注册界面对外接口
注册界面对外接口
################################ # PyQt5中文网 - PyQt5全套视频教程 # # https://www.PyQt5.cn/ # # 主讲: 村长 # ################################ from PyQt5.Qt import * import sys from pyqt5.Demo.resource.main_register import Register from pyqt5.Demo.resource.main_login import Login class Window1(QWidget): def __init__(self): super().__init__() self.setWindowTitle("对外接口 - PyQt5中文网") self.resize(600, 500) self.func_list() def func_list(self): self.func() def func(self): pass if __name__ == '__main__': app = QApplication(sys.argv) window = Register() window.register_signal.connect(lambda a, b: print(a, b)) login = Login() login.show() def check_login_cao(username, psd): if username == '85106210' and psd == '1234': window.show() login.hide() else: cutton = QPropertyAnimation(login) cutton.setTargetObject(login.widget_2) cutton.setPropertyName(b'pos') cutton.setKeyValueAt(0, login.widget_2.pos()) cutton.setKeyValueAt(0.2, login.widget_2.pos() + QPoint(15, 0)) cutton.setKeyValueAt(0.5, login.widget_2.pos()) cutton.setKeyValueAt(0.7, login.widget_2.pos() - QPoint(15, 0)) cutton.setKeyValueAt(1, login.widget_2.pos()) cutton.setDuration(100) cutton.setLoopCount(3) cutton.start(QAbstractAnimation.DeleteWhenStopped) login.show() login.login_signal.connect(check_login_cao) sys.exit(app.exec_())