From f71289bb4cef25fc2987eaf83828cb340bf9ce34 Mon Sep 17 00:00:00 2001 From: marques <20172333133@m.scnu.edu.cn> Date: Thu, 15 May 2025 15:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AA=97=E5=8F=A3=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E8=AE=BE=E7=BD=AE=EF=BC=8C=E6=94=B9=E4=B8=BA=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=B1=8F=E5=B9=95=E5=88=86=E8=BE=A8=E7=8E=87=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/Module_mainwindow.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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()