1. UI —MainWindow設(shè)計(jì)界面及代碼
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/media/sf_data/onemore_tjj/Again_tjj/MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(788, 634)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.groupBox_2 = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox_2.setGeometry(QtCore.QRect(40, 270, 691, 321))
self.groupBox_2.setObjectName("groupBox_2")
self.txtResume = QtWidgets.QTextEdit(self.groupBox_2)
self.txtResume.setGeometry(QtCore.QRect(10, 30, 671, 281))
self.txtResume.setObjectName("txtResume")
self.butGenerate = QtWidgets.QPushButton(self.centralwidget)
self.butGenerate.setGeometry(QtCore.QRect(390, 230, 101, 51))
self.butGenerate.setObjectName("butGenerate")
self.groupBox_3 = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox_3.setGeometry(QtCore.QRect(500, 10, 231, 271))
self.groupBox_3.setObjectName("groupBox_3")
self.label_6 = QtWidgets.QLabel(self.groupBox_3)
self.label_6.setGeometry(QtCore.QRect(6, 30, 221, 241))
self.label_6.setMinimumSize(QtCore.QSize(221, 0))
self.label_6.setMaximumSize(QtCore.QSize(221, 16777215))
self.label_6.setText("")
self.label_6.setPixmap(QtGui.QPixmap(":/tjj.jpg"))
self.label_6.setObjectName("label_6")
self.label_6.setScaledContents(True) #圖片自適應(yīng)
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox.setGeometry(QtCore.QRect(30, 20, 231, 201))
self.groupBox.setObjectName("groupBox")
self.txtName = QtWidgets.QLineEdit(self.groupBox)
self.txtName.setGeometry(QtCore.QRect(50, 30, 151, 25))
self.txtName.setObjectName("txtName")
self.label = QtWidgets.QLabel(self.groupBox)
self.label.setGeometry(QtCore.QRect(10, 32, 67, 17))
self.label.setObjectName("label")
self.txtRelationship = QtWidgets.QLineEdit(self.groupBox)
self.txtRelationship.setGeometry(QtCore.QRect(50, 60, 151, 25))
self.txtRelationship.setObjectName("txtRelationship")
self.label_2 = QtWidgets.QLabel(self.groupBox)
self.label_2.setGeometry(QtCore.QRect(6, 90, 67, 17))
self.label_2.setObjectName("label_2")
self.txtHobby = QtWidgets.QLineEdit(self.groupBox)
self.txtHobby.setGeometry(QtCore.QRect(48, 120, 151, 25))
self.txtHobby.setObjectName("txtHobby")
self.txtCharacter = QtWidgets.QLineEdit(self.groupBox)
self.txtCharacter.setGeometry(QtCore.QRect(48, 150, 151, 25))
self.txtCharacter.setObjectName("txtCharacter")
self.label_4 = QtWidgets.QLabel(self.groupBox)
self.label_4.setGeometry(QtCore.QRect(6, 122, 67, 17))
self.label_4.setObjectName("label_4")
self.label_3 = QtWidgets.QLabel(self.groupBox)
self.label_3.setGeometry(QtCore.QRect(6, 60, 67, 17))
self.label_3.setObjectName("label_3")
self.label_5 = QtWidgets.QLabel(self.groupBox)
self.label_5.setGeometry(QtCore.QRect(6, 153, 67, 17))
self.label_5.setObjectName("label_5")
self.txtSpecialty = QtWidgets.QLineEdit(self.groupBox)
self.txtSpecialty.setGeometry(QtCore.QRect(49, 90, 151, 25))
self.txtSpecialty.setObjectName("txtSpecialty")
self.groupBox_5 = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox_5.setGeometry(QtCore.QRect(270, 20, 221, 201))
self.groupBox_5.setObjectName("groupBox_5")
self.label_7 = QtWidgets.QLabel(self.groupBox_5)
self.label_7.setGeometry(QtCore.QRect(10, 40, 67, 17))
self.label_7.setObjectName("label_7")
self.label_8 = QtWidgets.QLabel(self.groupBox_5)
self.label_8.setGeometry(QtCore.QRect(10, 70, 67, 17))
self.label_8.setObjectName("label_8")
self.label_9 = QtWidgets.QLabel(self.groupBox_5)
self.label_9.setGeometry(QtCore.QRect(10, 100, 67, 17))
self.label_9.setObjectName("label_9")
self.label_10 = QtWidgets.QLabel(self.groupBox_5)
self.label_10.setGeometry(QtCore.QRect(10, 130, 67, 17))
self.label_10.setObjectName("label_10")
self.label_11 = QtWidgets.QLabel(self.groupBox_5)
self.label_11.setGeometry(QtCore.QRect(10, 160, 67, 17))
self.label_11.setObjectName("label_11")
self.txtHair = QtWidgets.QLineEdit(self.groupBox_5)
self.txtHair.setGeometry(QtCore.QRect(60, 40, 113, 25))
self.txtHair.setObjectName("txtHair")
self.txtHeight = QtWidgets.QLineEdit(self.groupBox_5)
self.txtHeight.setGeometry(QtCore.QRect(60, 70, 113, 25))
self.txtHeight.setObjectName("txtHeight")
self.txtWeight = QtWidgets.QLineEdit(self.groupBox_5)
self.txtWeight.setGeometry(QtCore.QRect(60, 100, 113, 25))
self.txtWeight.setObjectName("txtWeight")
self.txtOffice = QtWidgets.QLineEdit(self.groupBox_5)
self.txtOffice.setGeometry(QtCore.QRect(60, 130, 113, 25))
self.txtOffice.setObjectName("txtOffice")
self.txtAddress = QtWidgets.QLineEdit(self.groupBox_5)
self.txtAddress.setGeometry(QtCore.QRect(60, 160, 113, 25))
self.txtAddress.setObjectName("txtAddress")
self.label_14 = QtWidgets.QLabel(self.groupBox_5)
self.label_14.setGeometry(QtCore.QRect(175, 73, 67, 17))
self.label_14.setObjectName("label_14")
self.label_15 = QtWidgets.QLabel(self.groupBox_5)
self.label_15.setGeometry(QtCore.QRect(175, 101, 67, 17))
self.label_15.setObjectName("label_15")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
self.butGenerate.clicked.connect(MainWindow.Generate)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "介紹你青春里的那個(gè)她"))
self.groupBox_2.setTitle(_translate("MainWindow", "簡介:"))
self.butGenerate.setText(_translate("MainWindow", "生成"))
self.groupBox_3.setTitle(_translate("MainWindow", "照片"))
self.groupBox.setTitle(_translate("MainWindow", "我的朋友:"))
self.label.setText(_translate("MainWindow", "姓名:"))
self.label_2.setText(_translate("MainWindow", "特長:"))
self.label_4.setText(_translate("MainWindow", "愛好:"))
self.label_3.setText(_translate("MainWindow", "關(guān)系:"))
self.label_5.setText(_translate("MainWindow", "性格:"))
self.groupBox_5.setTitle(_translate("MainWindow", "簡介:"))
self.label_7.setText(_translate("MainWindow", "發(fā)型:"))
self.label_8.setText(_translate("MainWindow", "身高:"))
self.label_9.setText(_translate("MainWindow", "體重:"))
self.label_10.setText(_translate("MainWindow", "職務(wù):"))
self.label_11.setText(_translate("MainWindow", "住址:"))
self.label_14.setText(_translate("MainWindow", "m"))
self.label_15.setText(_translate("MainWindow", "kg"))
import picture_rc
2. 應(yīng)用程序代碼
3. 視頻播放程序圖片及代碼
4. 呈現(xiàn)效果
到此這篇關(guān)于基于Python+Pyqt5開發(fā)一個(gè)應(yīng)用程序的文章就介紹到這了,更多相關(guān)Python+Pyqt5應(yīng)用程序內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!