diff --git a/interface/init/__init__.py b/interface/init/__init__.py index 52700cf..854e6c1 100644 --- a/interface/init/__init__.py +++ b/interface/init/__init__.py @@ -27,13 +27,13 @@ class InitWindow(QWidget): # 初始化布局 self.layout = QVBoxLayout(self) - self.titleLabel = SubtitleLabel('初始化') + # 将组件添加到布局中 + self.layout.addWidget(AboutWidget()) + self.start_button = PushButton('开始') self.start_button.clicked.connect(self.run) self.layout.addWidget(self.start_button) - # 将组件添加到布局中 - self.layout.addWidget(self.titleLabel) - self.layout.addWidget(AboutWidget()) + # 应用布局 self.setLayout(self.layout) diff --git a/interface/init/about.py b/interface/init/about.py index 95983aa..03d6855 100644 --- a/interface/init/about.py +++ b/interface/init/about.py @@ -1,8 +1,17 @@ -from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel - +from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QSizePolicy +from PyQt5.QtGui import QPixmap class AboutWidget(QWidget): def __init__(self, typex="init"): super().__init__() - self.base = QVBoxLayout() - self.base.addWidget(QLabel("About")) + self.base = QHBoxLayout() + + logo = QPixmap("resources/logo.png") + logo_label = QLabel() + logo_label.setPixmap(logo) + logo_label.setScaledContents(True) + # 自适应图片大小 + logo_label.setFixedSize(int(logo_label.height() * 0.4), int(logo_label.height() * 0.4)) + # logo_label.setFixedSize(50, 50) + self.base.addWidget(logo_label) + self.setLayout(self.base) \ No newline at end of file diff --git a/resources/logo.png b/resources/logo.png new file mode 100644 index 0000000..c2e31e2 Binary files /dev/null and b/resources/logo.png differ