日期计算助手已完成
作者:互联网
本软件是由pyside6实现的gui界面
首先是ui部分,这部分是用qt设计师布局,用vscode中的插件Qt for Python转换成的.py文件。
布局图片如下:
转换后的代码如下:
# -*- coding: utf-8 -*-################################################################################ ## Form generated from reading UI file 'jichu.ui' ## ## Created by: Qt User Interface Compiler version 6.3.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, QMetaObject, QObject, QPoint, QRect, QSize, QTime, QUrl, Qt) from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QGradient, QIcon, QImage, QKeySequence, QLinearGradient, QPainter, QPalette, QPixmap, QRadialGradient, QTransform) from PySide6.QtWidgets import (QApplication, QCommandLinkButton, QLabel, QLineEdit, QMainWindow, QPushButton, QSizePolicy, QTextEdit, QWidget)
class Ui_roos(object): def setupUi(self, roos): if not roos.objectName(): roos.setObjectName(u"roos") roos.resize(550, 210) roos.setMinimumSize(QSize(550, 210)) roos.setMaximumSize(QSize(550, 210)) self.centralwidget = QWidget(roos) self.centralwidget.setObjectName(u"centralwidget") self.pushButton = QPushButton(self.centralwidget) self.pushButton.setObjectName(u"pushButton") self.pushButton.setGeometry(QRect(220, 100, 100, 30)) self.pushButton.setMinimumSize(QSize(100, 30)) self.pushButton.setMaximumSize(QSize(100, 30)) self.lineEdit = QLineEdit(self.centralwidget) self.lineEdit.setObjectName(u"lineEdit") self.lineEdit.setGeometry(QRect(60, 100, 100, 30)) self.lineEdit.setMinimumSize(QSize(100, 30)) self.lineEdit.setMaximumSize(QSize(100, 30)) self.textEdit = QTextEdit(self.centralwidget) self.textEdit.setObjectName(u"textEdit") self.textEdit.setGeometry(QRect(380, 100, 100, 30)) self.textEdit.setMinimumSize(QSize(100, 30)) self.textEdit.setMaximumSize(QSize(100, 30)) self.label = QLabel(self.centralwidget) self.label.setObjectName(u"label") self.label.setGeometry(QRect(180, 10, 201, 61)) font = QFont() font.setPointSize(24) font.setBold(True) self.label.setFont(font) self.commandLinkButton = QCommandLinkButton(self.centralwidget) self.commandLinkButton.setObjectName(u"commandLinkButton") self.commandLinkButton.setGeometry(QRect(410, 160, 151, 71)) font1 = QFont() font1.setFamilies([u"Segoe UI"]) font1.setPointSize(16) self.commandLinkButton.setFont(font1) roos.setCentralWidget(self.centralwidget)
self.retranslateUi(roos)
QMetaObject.connectSlotsByName(roos) # setupUi
def retranslateUi(self, roos): roos.setWindowTitle(QCoreApplication.translate("roos", u"MainWindow", None)) self.pushButton.setText(QCoreApplication.translate("roos", u"\u8ba1\u7b97", None)) self.label.setText(QCoreApplication.translate("roos", u"\u65e5\u671f\u8ba1\u7b97\u52a9\u624b", None)) self.commandLinkButton.setText(QCoreApplication.translate("roos", u"\u5982\u4f55\u4f7f\u7528", None)) # retranslateUi
有点太长了,剩下的内容写在下一篇
标签:QSize,centralwidget,self,30,日期,助手,计算,100,roos 来源: https://www.cnblogs.com/xxl-0321/p/16695654.html