文件名称:一个简单的Python的GUI程序
文件大小:4KB
文件格式:UI
更新时间:2021-12-22 08:44:23
Python GUI
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'aaa.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! import sys, os from PyQt5 import QtCore, QtWidgets, QtGui from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5 import QtCore, QtGui, QtWidgets class U_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1204, 836) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.tableWidget = QtWidgets.QTableWidget(self.centralwidget) self.tableWidget.setGeometry(QtCore.QRect(80, 240, 1041, 371)) self.tableWidget.setAutoScrollMargin(9) self.tableWidget.setRowCount(9) self.tableWidget.setColumnCount(8) self.tableWidget.setObjectName("tableWidget") item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(1, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(2, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(3, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(4, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(5, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(6, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(7, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(8, item) item = QtWidgets.QTableWidgetItem() font = QtGui.QFont() font.setPointSize(8) item.setFont(font) self.tableWidget.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(2, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(3, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(4, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(5, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(6, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(7, item) self.tableWidget.horizontalHeader().setCascadingSectionResizes(True) self.pushButton = QtWidgets.QPushButton(self.centralwidget) self.pushButton.setGeometry(QtCore.QRect(130, 720, 221, 28)) self.pushButton.setObjectName("pushButton") self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_4.setGeometry(QtCore.QRect(860, 720, 61, 28)) self.pushButton_4.setObjectName("pushButton_4") self.checkBox_5 = QtWidgets.QCheckBox(self.centralwidget) self.checkBox_5.setGeometry(QtCore.QRect(840, 630, 91, 19)) self.checkBox_5.setObjectName("checkBox_5") self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_2.setGeometry(QtCore.QRect(740, 630, 93, 21)) self.pushButton_2.setObjectName("pushButton_2") self.pushButton_5 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_5.setGeometry(QtCore.QRect(130, 670, 93, 28)) self.pushButton_5.setObjectName("pushButton_5") self.pushButton_6 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_6.setGeometry(QtCore.QRect(740, 720, 93, 28)) self.pushButton_6.setObjectName("pushButton_6") self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_3.setGeometry(QtCore.QRect(940, 720, 81, 28)) self.pushButton_3.setObjectName("pushButton_3") self.pushButton_7 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_7.setGeometry(QtCore.QRect(940, 670, 81, 28)) self.pushButton_7.setObjectName("pushButton_7") self.radioButton = QtWidgets.QRadioButton(self.centralwidget) self.radioButton.setGeometry(QtCore.QRect(100, 260, 115, 19)) self.radioButton.setText("") self.radioButton.setObjectName("radioButton") self.radioButton_2 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_2.setGeometry(QtCore.QRect(100, 310, 115, 19)) self.radioButton_2.setText("") self.radioButton_2.setObjectName("radioButton_2") self.radioButton_3 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_3.setGeometry(QtCore.QRect(100, 350, 115, 19)) self.radioButton_3.setText("") self.radioButton_3.setObjectName("radioButton_3") self.radioButton_4 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_4.setGeometry(QtCore.QRect(100, 390, 115, 19)) self.radioButton_4.setText("") self.radioButton_4.setObjectName("radioButton_4") self.radioButton_5 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_5.setGeometry(QtCore.QRect(100, 420, 115, 19)) self.radioButton_5.setText("") self.radioButton_5.setObjectName("radioButton_5") self.radioButton_6 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_6.setGeometry(QtCore.QRect(100, 460, 115, 19)) self.radioButton_6.setText("") self.radioButton_6.setObjectName("radioButton_6") self.radioButton_7 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_7.setGeometry(QtCore.QRect(100, 500, 115, 19)) self.radioButton_7.setText("") self.radioButton_7.setObjectName("radioButton_7") self.radioButton_8 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_8.setGeometry(QtCore.QRect(100, 540, 115, 19)) self.radioButton_8.setText("") self.radioButton_8.setObjectName("radioButton_8") self.radioButton_9 = QtWidgets.QRadioButton(self.centralwidget) self.radioButton_9.setGeometry(QtCore.QRect(100, 570, 115, 19)) self.radioButton_9.setText("") self.radioButton_9.setObjectName("radioButton_9") self.widget = QtWidgets.QWidget(self.centralwidget) self.widget.setGeometry(QtCore.QRect(80, 30, 1041, 191)) self.widget.setObjectName("widget") self.verticalLayout = QtWidgets.QVBoxLayout(self.widget) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.lineEdit = QtWidgets.QLineEdit(self.widget) self.lineEdit.setEnabled(False) self.lineEdit.setObjectName("lineEdit") self.horizontalLayout.addWidget(self.lineEdit) self.lineEdit_2 = QtWidgets.QLineEdit(self.widget) self.lineEdit_2.setText("") self.lineEdit_2.setObjectName("lineEdit_2") self.horizontalLayout.addWidget(self.lineEdit_2) self.horizontalLayout.setStretch(0, 3) self.horizontalLayout.setStretch(1, 9) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.lineEdit_3 = QtWidgets.QLineEdit(self.widget) self.lineEdit_3.setEnabled(False) self.lineEdit_3.setObjectName("lineEdit_3") self.horizontalLayout_2.addWidget(self.lineEdit_3) self.lineEdit_4 = QtWidgets.QLineEdit(self.widget) self.lineEdit_4.setObjectName("lineEdit_4") self.horizontalLayout_2.addWidget(self.lineEdit_4) self.lineEdit_5 = QtWidgets.QLineEdit(self.widget) self.lineEdit_5.setEnabled(False) self.lineEdit_5.setObjectName("lineEdit_5") self.horizontalLayout_2.addWidget(self.lineEdit_5) self.lineEdit_6 = QtWidgets.QLineEdit(self.widget) self.lineEdit_6.setObjectName("lineEdit_6") self.horizontalLayout_2.addWidget(self.lineEdit_6) self.horizontalLayout_2.setStretch(0, 3) self.horizontalLayout_2.setStretch(1, 3) self.horizontalLayout_2.setStretch(2, 3) self.horizontalLayout_2.setStretch(3, 3) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.lineEdit_7 = QtWidgets.QLineEdit(self.widget) self.lineEdit_7.setEnabled(False) self.lineEdit_7.setObjectName("lineEdit_7") self.horizontalLayout_3.addWidget(self.lineEdit_7) self.lineEdit_8 = QtWidgets.QLineEdit(self.widget) self.lineEdit_8.setObjectName("lineEdit_8") self.horizontalLayout_3.addWidget(self.lineEdit_8) self.lineEdit_9 = QtWidgets.QLineEdit(self.widget) self.lineEdit_9.setEnabled(False) self.lineEdit_9.setObjectName("lineEdit_9") self.horizontalLayout_3.addWidget(self.lineEdit_9) self.lineEdit_10 = QtWidgets.QLineEdit(self.widget) self.lineEdit_10.setObjectName("lineEdit_10") self.horizontalLayout_3.addWidget(self.lineEdit_10) self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.checkBox_4 = QtWidgets.QCheckBox(self.widget) self.checkBox_4.setObjectName("checkBox_4") self.horizontalLayout_4.addWidget(self.checkBox_4) self.checkBox_3 = QtWidgets.QCheckBox(self.widget) self.checkBox_3.setObjectName("checkBox_3") self.horizontalLayout_4.addWidget(self.checkBox_3) self.checkBox_2 = QtWidgets.QCheckBox(self.widget) self.checkBox_2.setObjectName("checkBox_2") self.horizontalLayout_4.addWidget(self.checkBox_2) self.checkBox = QtWidgets.QCheckBox(self.widget) self.checkBox.setObjectName("checkBox") self.horizontalLayout_4.addWidget(self.checkBox) self.verticalLayout.addLayout(self.horizontalLayout_4) # MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1204, 26)) self.menubar.setObjectName("menubar") # MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") # MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) item = self.tableWidget.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "ModelDef")) item = self.tableWidget.horizontalHeaderItem(2) item.setText(_translate("MainWindow", "Item Name")) item = self.tableWidget.horizontalHeaderItem(3) item.setText(_translate("MainWindow", "Phase")) item = self.tableWidget.horizontalHeaderItem(4) item.setText(_translate("MainWindow", "Variant")) item = self.tableWidget.horizontalHeaderItem(5) item.setText(_translate("MainWindow", "Model Name")) item = self.tableWidget.horizontalHeaderItem(6) item.setText(_translate("MainWindow", "Model")) item = self.tableWidget.horizontalHeaderItem(7) item.setText(_translate("MainWindow", "Additional")) self.pushButton.setText(_translate("MainWindow", "MSG Box")) self.pushButton_4.setText(_translate("MainWindow", "Clear")) self.checkBox_5.setText(_translate("MainWindow", "DelOriginal")) self.pushButton_2.setText(_translate("MainWindow", "Generate")) self.pushButton_5.setText(_translate("MainWindow", "check ")) self.pushButton_6.setText(_translate("MainWindow", "Refresh")) self.pushButton_3.setText(_translate("MainWindow", "Import ")) self.pushButton_7.setText(_translate("MainWindow", "Export")) self.lineEdit.setText(_translate("MainWindow", "Project Name:")) self.lineEdit_3.setText(_translate("MainWindow", "Discipline:")) self.lineEdit_5.setText(_translate("MainWindow", "LoadCase:")) self.lineEdit_7.setText(_translate("MainWindow", "Project phase:")) self.lineEdit_9.setText(_translate("MainWindow", "Varint:")) self.checkBox_4.setText(_translate("MainWindow", "Loadcase")) self.checkBox_3.setText(_translate("MainWindow", "CheckBox")) self.checkBox_2.setText(_translate("MainWindow", "Loadcase2")) self.checkBox.setText(_translate("MainWindow", "CheckBox")) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) form = QWidget() w = U_MainWindow() #Ui_类名() w.setupUi(form) form.show() sys.exit(app.exec_())