• 大小: 897KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: 其他
  • 标签: pyqt5  

资源简介

使用pyqt5和pyqt Designer实现的登录功能...........................................................................

资源截图

代码片段和文件信息

import sys
import pymysql
from Python_tensorflow_LicensePlate.utils.Pymysql import *
from PyQt5.QtWidgets import *
from Python_tensorflow_LicensePlate.front.FPwd import *   # 导入文件的顺序不同会导致文件类识别异常,原因未知
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(“欢迎使用停车场管理系统“)
        self.setFixedSize(self.width() self.height())
        self.ui.labelTip.hide()
        self.ui.labelTip.setText(“密码或用户名不能为空!“)
        # 设置label字体
        labelFont = QFont()
        labelFont.setPixelSize(15)
        # 设置动态背景
        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

评论

共有 条评论