1. 程式人生 > >pyqt5實現註冊界面

pyqt5實現註冊界面

性別 gin ini push edi cnblogs win 分享 style

技術分享圖片

技術分享圖片

__author__ = sign_in
import sys
from PyQt5.QtGui import  QPixmap
from PyQt5.QtWidgets import *
class login(QWidget):
    def __init__(self):
        super(login,self).__init__()
        self.initUi()

    def initUi(self):
        self.setWindowTitle("login")
        layout = QGridLayout()
        self.setGeometry(
600, 600, 400, 400) nameLabel = QLabel("姓名") nameLineEdit = QLineEdit(" ") sexLabel = QLabel("性別") sexLineEdit = QLineEdit(" ") emitLabel = QLabel("手機號") emitLineEdit = QLineEdit("") timeLabel = QLabel("郵箱") timeLineEdit = QLineEdit("")
# layout.setSpacing(10) layout.addWidget(nameLabel,1,0) layout.addWidget(nameLineEdit,1,1) layout.addWidget(sexLabel, 2, 0) layout.addWidget(sexLineEdit, 2, 1) layout.addWidget(emitLabel,3,0) layout.addWidget(emitLineEdit,3,1) layout.addWidget(timeLabel,
4,0) layout.addWidget(timeLineEdit,4,1) layout.setColumnStretch(1, 10) save_Btn = QPushButton(保存) cancle_Btn = QPushButton(取消) clean_Btn = QPushButton(清除) layout.addWidget(save_Btn) layout.addWidget(cancle_Btn) self.setLayout(layout) if __name__ == __main__: app = QApplication(sys.argv) ex = login() ex.show() sys.exit(app.exec_())

pyqt5實現註冊界面