diff --git a/func/Module_mainwindow.py b/func/Module_mainwindow.py index f6ba025..f817539 100644 --- a/func/Module_mainwindow.py +++ b/func/Module_mainwindow.py @@ -1,6 +1,7 @@ from pathlib import Path from PySide6.QtWidgets import QMainWindow, QMessageBox, QFileDialog +from PySide6.QtGui import QGuiApplication from matplotlib import use from yaml import dump, load, FullLoader @@ -34,7 +35,15 @@ class MainWindow(QMainWindow, Ui_Signal_Label): self.ui = Ui_Signal_Label() self.ui.setupUi(self) - self.setFixedSize(720, 1080) # 设置固定大小,禁止缩放 + # self.setFixedSize(720, 1080) # 设置固定大小,禁止缩放 + # 获得屏幕分辨率,以3:4比例设置窗口大小, + screen = QGuiApplication.primaryScreen() + size = screen.availableGeometry() + screen_height = size.height() + + window_height = int(screen_height * 0.75) + window_width = int(window_height * 1 / 2) + self.resize(window_width, window_height) # 消息弹窗初始化 self.msgBox = QMessageBox()