From cc7e246d65d65ddc0d98fa7e504e7874a8d8fe60 Mon Sep 17 00:00:00 2001 From: Yorusora <2023025086@m.scnu.edu.cn> Date: Wed, 11 Jun 2025 23:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/Module_mainwindow.py | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/func/Module_mainwindow.py b/func/Module_mainwindow.py index cd836f0..e634068 100644 --- a/func/Module_mainwindow.py +++ b/func/Module_mainwindow.py @@ -5,6 +5,7 @@ from PySide6.QtCore import Qt from PySide6.QtWidgets import QMainWindow, QMessageBox, QFileDialog, QApplication, QWidget from PySide6.QtGui import QGuiApplication from matplotlib import use +from matplotlib.backends.backend_qt import NavigationToolbar2QT from yaml import dump, load, FullLoader from func.utils.PublicFunc import PublicFunc @@ -365,21 +366,6 @@ class MainWindow(QMainWindow, Ui_Signal_Label): path.mkdir(parents=True, exist_ok=True) def set_dark_mode_status(self): - module_list = [ - self, - self.approximately_align, - self.preprocess, - self.detect_Jpeak, - self.detect_Rpeak, - self.label_check, - self.precisely_align, - self.cut_PSG, - self.artifact_label, - self.bcg_quality_label, - self.resp_quality_label, - self.SA_label - ] - try: if self.ui.checkBox_darkmode.isChecked(): QApplication.styleHints().setColorScheme(Qt.ColorScheme.Dark) @@ -387,23 +373,4 @@ class MainWindow(QMainWindow, Ui_Signal_Label): QApplication.styleHints().setColorScheme(Qt.ColorScheme.Light) except Exception as e: PublicFunc.msgbox_output(self, Constants.MAINWINDOW_DARKMODE_FAILURE + "。" + format_exc(), Constants.MSGBOX_TYPE_ERROR) - return - - for module in module_list: - try: - if module is not None: - MainWindow.update_widget_style(module) - except RuntimeError: - pass - - @staticmethod - def update_widget_style(mainWindow): - all_widgets = mainWindow.centralWidget().findChildren(QWidget) - # 迭代所有部件 - for widget in all_widgets: - try: - widget.style().unpolish(widget) - widget.style().polish(widget) - widget.update() - except TypeError: - pass \ No newline at end of file + return \ No newline at end of file