Files
JITToolBox/ui/pyui/about_ui.py
2025-05-20 18:30:00 +08:00

59 lines
2.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from PySide6.QtGui import QDesktopServices, Qt
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout
from qfluentwidgets import PrimaryPushSettingCard, FluentIcon, GroupHeaderCardWidget, PushButton, ImageLabel, TitleLabel
from ui.components.widget import Widget
class AboutWidget(Widget):
def __init__(self, key: str, parent=None):
super().__init__(key, parent)
self.logoImage = ImageLabel(':/images/logo.png')
self.logoImage.scaledToHeight(100)
self.appNameLabel = TitleLabel('建工工具箱🛠️')
self.hBox = QHBoxLayout()
self.hBox.addWidget(self.logoImage, 0, Qt.AlignLeft)
self.hBox.addWidget(self.appNameLabel, 1, Qt.AlignLeft)
self.version_card = PrimaryPushSettingCard(
text="获取源码",
icon=FluentIcon.INFO,
title="关于",
content="作者许方杰。当前版本1.0.0\n本软件使用 GPLv3 开源协议进行分发,作者不对使用本软件造成的任何损失负责。"
)
self.button_list = [
PushButton("访问网站"),
PushButton("访问网站"),
PushButton("访问网站"),
PushButton("访问网站"),
]
self.url_list = [
"https://qt.io",
"https://qfluentwidgets.com",
"https://openpyxl.readthedocs.io/en/stable",
"https://github.com/python-openxml/python-docx"
]
self.group_card = GroupHeaderCardWidget(self)
self.group_card.setTitle("第三方框架")
self.vbox = QVBoxLayout(self)
self.vbox.addLayout(self.hBox)
self.vbox.addWidget(self.version_card)
self.vbox.addWidget(self.group_card)
self.vbox.addStretch(1)
self.group_card.addGroup("", "PySide6", self.url_list[0], self.button_list[0])
self.group_card.addGroup("", "QFluentWidgets", self.url_list[1], self.button_list[1])
self.group_card.addGroup("", "openpyxl", self.url_list[2], self.button_list[2])
self.group_card.addGroup("", "python-docx", self.url_list[3], self.button_list[3])
self.version_card.clicked.connect(
lambda: QDesktopServices.openUrl("https://cantyonion.site/git/cantyonion/DefenseTopicGenerator")
)
self.button_list[0].clicked.connect(lambda: QDesktopServices.openUrl(self.url_list[0]))
self.button_list[1].clicked.connect(lambda: QDesktopServices.openUrl(self.url_list[1]))
self.button_list[2].clicked.connect(lambda: QDesktopServices.openUrl(self.url_list[2]))
self.button_list[3].clicked.connect(lambda: QDesktopServices.openUrl(self.url_list[3]))