本文实例为大家分享了PyQt5实现登录页面的具体代码,供大家参考,具体内容如下
效果图:
python代码:
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QPainter, QColor, QFont, QIcon
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication, QLabel, QDesktopWidget, QHBoxLayout, QFormLayout, \
QPushButton, QLineEdit
class LoginForm(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
"""
初始化UI
:return:
"""
self.setObjectName("loginWindow")
self.setStyleSheet('#loginWindow{background-color:white}')
self.setFixedSize(650, 400)
self.setWindowTitle("登录")
self.setWindowIcon(QIcon('static/logo_title.png'))
sel