impr: TabAbout version info

This commit is contained in:
2023-09-21 23:45:40 +08:00
parent d29104744d
commit 0f53cb8d5b
6 changed files with 169 additions and 90 deletions

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>587</width>
<height>431</height>
<width>550</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
@ -80,6 +80,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="versionInfoButton">
<property name="text">
<string>Version Info</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">

View File

@ -1,87 +1,93 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'tabAbout.ui'
##
## Created by: Qt User Interface Compiler version 6.5.0
##
## 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, QHBoxLayout, QLabel, QPushButton,
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)
class Ui_TabAbout(object):
def setupUi(self, TabAbout):
if not TabAbout.objectName():
TabAbout.setObjectName(u"TabAbout")
TabAbout.resize(587, 431)
TabAbout.setWindowTitle(u"TabAbout")
self.verticalLayout = QVBoxLayout(TabAbout)
self.verticalLayout.setObjectName(u"verticalLayout")
self.logoLabel = QLabel(TabAbout)
self.logoLabel.setObjectName(u"logoLabel")
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.logoLabel.sizePolicy().hasHeightForWidth())
self.logoLabel.setSizePolicy(sizePolicy)
self.logoLabel.setText(u"")
self.logoLabel.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.logoLabel)
self.label = QLabel(TabAbout)
self.label.setObjectName(u"label")
font = QFont()
font.setPointSize(14)
self.label.setFont(font)
self.label.setText(u"arcaea-offline-pyside-ui")
self.label.setAlignment(Qt.AlignBottom|Qt.AlignHCenter)
self.verticalLayout.addWidget(self.label)
self.label_2 = QLabel(TabAbout)
self.label_2.setObjectName(u"label_2")
self.label_2.setText(u"A part of <a href=\"https://github.com/283375/arcaea-offline\">arcaea-offline project</a>")
self.label_2.setAlignment(Qt.AlignHCenter|Qt.AlignTop)
self.label_2.setOpenExternalLinks(True)
self.verticalLayout.addWidget(self.label_2)
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(self.horizontalSpacer)
self.aboutQtButton = QPushButton(TabAbout)
self.aboutQtButton.setObjectName(u"aboutQtButton")
self.horizontalLayout.addWidget(self.aboutQtButton)
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(self.horizontalSpacer_2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.retranslateUi(TabAbout)
QMetaObject.connectSlotsByName(TabAbout)
# setupUi
def retranslateUi(self, TabAbout):
self.aboutQtButton.setText(QCoreApplication.translate("TabAbout", u"About Qt", None))
pass
# retranslateUi
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'tabAbout.ui'
##
## Created by: Qt User Interface Compiler version 6.5.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, QHBoxLayout, QLabel, QPushButton,
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)
class Ui_TabAbout(object):
def setupUi(self, TabAbout):
if not TabAbout.objectName():
TabAbout.setObjectName(u"TabAbout")
TabAbout.resize(550, 400)
TabAbout.setWindowTitle(u"TabAbout")
self.verticalLayout = QVBoxLayout(TabAbout)
self.verticalLayout.setObjectName(u"verticalLayout")
self.logoLabel = QLabel(TabAbout)
self.logoLabel.setObjectName(u"logoLabel")
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.logoLabel.sizePolicy().hasHeightForWidth())
self.logoLabel.setSizePolicy(sizePolicy)
self.logoLabel.setText(u"")
self.logoLabel.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.logoLabel)
self.label = QLabel(TabAbout)
self.label.setObjectName(u"label")
font = QFont()
font.setPointSize(14)
self.label.setFont(font)
self.label.setText(u"arcaea-offline-pyside-ui")
self.label.setAlignment(Qt.AlignBottom|Qt.AlignHCenter)
self.verticalLayout.addWidget(self.label)
self.label_2 = QLabel(TabAbout)
self.label_2.setObjectName(u"label_2")
self.label_2.setText(u"A part of <a href=\"https://github.com/283375/arcaea-offline\">arcaea-offline project</a>")
self.label_2.setAlignment(Qt.AlignHCenter|Qt.AlignTop)
self.label_2.setOpenExternalLinks(True)
self.verticalLayout.addWidget(self.label_2)
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(self.horizontalSpacer)
self.aboutQtButton = QPushButton(TabAbout)
self.aboutQtButton.setObjectName(u"aboutQtButton")
self.horizontalLayout.addWidget(self.aboutQtButton)
self.versionInfoButton = QPushButton(TabAbout)
self.versionInfoButton.setObjectName(u"versionInfoButton")
self.horizontalLayout.addWidget(self.versionInfoButton)
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(self.horizontalSpacer_2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.retranslateUi(TabAbout)
QMetaObject.connectSlotsByName(TabAbout)
# setupUi
def retranslateUi(self, TabAbout):
self.aboutQtButton.setText(QCoreApplication.translate("TabAbout", u"About Qt", None))
self.versionInfoButton.setText(QCoreApplication.translate("TabAbout", u"Version Info", None))
pass
# retranslateUi

View File

@ -1,4 +1,4 @@
from PySide6.QtCore import Qt, Slot
from PySide6.QtCore import QFile, Qt, Slot
from PySide6.QtGui import QPixmap
from PySide6.QtWidgets import QMessageBox, QWidget
@ -21,3 +21,11 @@ class TabAbout(Ui_TabAbout, QWidget):
@Slot()
def on_aboutQtButton_clicked(self):
QMessageBox.aboutQt(self)
@Slot()
def on_versionInfoButton_clicked(self):
versionFile = QFile(":/VERSION")
versionFile.open(QFile.OpenModeFlag.ReadOnly)
versionText = str(versionFile.readAll(), encoding="utf-8")
versionFile.close()
QMessageBox.information(self, None, versionText)

View File

@ -1,6 +1,8 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/">
<file>VERSION</file>
<file>images/icon.png</file>
<file>images/logo.png</file>
<file>images/stepCalculator/stamina.png</file>