Python GUI编程网 > pyqt5快速开发与实战 > 注册界面对外接口
python教程

注册界面对外接口

发布日期:2021年4月29日 01:11
阅读:2238
作者:Python GUI编程网

注册界面对外接口

00:00 / 01:23
1x
2x
1.5x
1.25x
1x
0.8x
0.5x

注册界面对外接口

################################
# 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_())