Python GUI编程网 > pyqt5快速开发与实战 > 登陆功能完善和界面抖动动画效果实现
python教程

登陆功能完善和界面抖动动画效果实现

发布日期:2021年4月30日 04:42
阅读:5027
作者:Python GUI编程网

登陆功能完善和界面抖动动画效果实现

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

登陆功能完善和界面抖动动画效果实现

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