1. UI —MainWindow设计界面及代码
# -*- 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) #图片自适应
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", "介绍你青春里的那个她"))
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", "关系:"))
self.label_5.setText(_translate("MainWindow", "性格:"))
self.groupBox_5.setTitle(_translate("MainWindow", "简介:"))
self.label_7.setText(_translate("MainWindow", "发型:"))
self.label_8.setText(_translate("MainWindow", "身高:"))
self.label_9.setText(_translate("MainWindow", "体重:"))
self.label_10.setText(_translate("MainWindow", "职务:"))
self.label_11.setText(_translate("MainWindow", "住址:"))
self.label_14.setText(_translate("MainWindow", "m"))
self.label_15.setText(_translate("MainWindow", "kg"))
import picture_rc
2. 应用程序代码
3. 视频播放程序图片及代码
4. 呈现效果
到此这篇关于基于Python+Pyqt5开发一个应用程序的文章就介绍到这了,更多相关Python+Pyqt5应用程序内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!