資源簡介
使用pyqt5和pyqt Designer實現(xiàn)的登錄功能...........................................................................

代碼片段和文件信息
import?sys
import?pymysql
from?Python_tensorflow_LicensePlate.utils.Pymysql?import?*
from?PyQt5.QtWidgets?import?*
from?Python_tensorflow_LicensePlate.front.FPwd?import?*???#?導(dǎo)入文件的順序不同會導(dǎo)致文件類識別異常,原因未知
from?PyQt5?import?QtWidgets?QtCore?QtGui
from?PyQt5.QtCore?import?*
from?PyQt5.QtGui?import?*
from?Python_tensorflow_LicensePlate.front.loginUI?import?*
from?Python_tensorflow_LicensePlate.front.register?import?*
from?Python_tensorflow_LicensePlate.front.Db_finance?import?*
from?Python_tensorflow_LicensePlate.front.ComInfoManager?import?*
from?Python_tensorflow_LicensePlate.front.Db_seatManager?import?*
from?Python_tensorflow_LicensePlate.front.Db_admin?import?*
from?loginUI?import?*
from?PyQt5.QtWidgets?import?QWidget
from?PyQt5?.QtGui?import?*
from?PyQt5.QtCore?import?*
#colon?expected?缺少冒號
class?Login(QtWidgets.QDialog):
????def?__init__(self):
????????super(Login?self).__init__()
????????self.ui?=?Ui_login_Ui()
????????self.ui.setupUi(self)
????????#?self.setMinimumSize(QtCore.QSize(400?200))??#?控制縮放范圍
????????#?self.setMaximumSize(QtCore.QSize(400?200))
????????self.setWindowtitle(“歡迎使用停車場管理系統(tǒng)“)
????????self.setFixedSize(self.width()?self.height())
????????self.ui.labelTip.hide()
????????self.ui.labelTip.setText(“密碼或用戶名不能為空!“)
????????#?設(shè)置label字體
????????labelFont?=?QFont()
????????labelFont.setPixelSize(15)
????????#?設(shè)置動態(tài)背景
????????self.gif?=?QMovie(‘bg2.gif‘)
????????self.ui.label_2.setMovie(self.gif)
????????self.gif.start()
????????#?這在label屬性
????????self.ui.labelTip.setstyleSheet(
????????????“QLabel{color:red;font-size:12px;font-weight:bold;font-family:Roman?times;}“
????????????????????????????????????)
????????self.ui.userLabel.setstyleSheet(“QLabel{background:white;}“
???????????????????“QLabel{color:rgb(100100100250);font-size:15px;font-weight:bold;font-family:Roman?times;}“
???????????????????“QLabel:hover{color:rgb(300300300120);}“)
????????self.ui.pwdlabel.setstyleSheet(“QLabel{background:white;}“
???????????????????“QLabel{color:rgb(100100100250);font-size:15px;font-weight:bold;font-family:Roman?times;}“
???????????????????“QLabel:hover{color:rgb(300300300120);}“)
????????self.ui.label.setstyleSheet(“QLabel{background:white;}“
????????????????????“QLabel{color:rgb(100100100250);font-size:15px;font-weight:bold;font-family:Roman?times;}“
????????????????????“QLabel:hover{color:rgb(300300300120);}“)
????????#?登錄注冊添加hover選擇器失敗
????????#?self.ui.registerButton.setstyleSheet(“QPushButton{color:blue}“
????????#??????????????????????????????????????“QPushButton:hover{color:red}“)
????????#?self.ui.loginButton.setstyleSheet(“QPushButton:hover{color:rgb(300300300120)}“)
????????#?self.ui.loginButton.setstyleSheet(“background-color:white“)
????????#?self.ui.registerButton.setstyleSheet(“background-color:white“)
????????self.ui.loginButton.setstyleSheet(“QPushButton{color:black}“
???????????????????????????????????????????????“QPushButton:hover{color:red}“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-16?22:36??pyqt5登錄功能\
?????文件??????925190??2018-06-27?11:25??pyqt5登錄功能\bg2.gif
?????文件????????9972??2018-08-16?22:26??pyqt5登錄功能\Login.py
?????文件????????4241??2018-07-01?15:58??pyqt5登錄功能\loginUI.py
評論
共有 條評論