From 7205bc8f87048d2ab2c5b3072eb0f40886895ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:20:07 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/dynalang.py | 7 +++++-- LunaTranslator/LunaTranslator/gui/usefulwidget.py | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dynalang.py b/LunaTranslator/LunaTranslator/gui/dynalang.py index 27d6f3ff..0b8c3645 100644 --- a/LunaTranslator/LunaTranslator/gui/dynalang.py +++ b/LunaTranslator/LunaTranslator/gui/dynalang.py @@ -107,7 +107,7 @@ class LCheckBox(QCheckBox, LBase): super().setText(_TR(self._text)) -class LGroupBox(QGroupBox, LBase): +class LGroupBox(QGroupBox): def __init__(self, *argc, **kwarg): super().__init__(*argc, **kwarg) @@ -122,7 +122,10 @@ class LGroupBox(QGroupBox, LBase): super().setTitle(_TR(self._text)) def changeEvent(self, e: QEvent): - super(LGroupBox, self).changeEvent(e) + if e.type() == QEvent.Type.LanguageChange: + self.updatelangtext() + super().changeEvent(e) + class LListWidgetItem(QListWidgetItem): def __init__(self, text): diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index 94f0de5e..3920012a 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -58,9 +58,6 @@ class LFocusCombo(FocusCombo, LBase): for i in range(self.count()): self.setItemText(i, _TR(self.__items[i])) - def changeEvent(self, e: QEvent): - super(LFocusCombo, self).changeEvent(e) - class FocusFontCombo(QFontComboBox, FocusCombo): pass