From 0c90c6ca7d2f04ce27a004a4bf460702c9df736e 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: Wed, 14 Aug 2024 12:04:13 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/edittext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/edittext.py b/LunaTranslator/LunaTranslator/gui/edittext.py index 95f4978e..5d8c6858 100644 --- a/LunaTranslator/LunaTranslator/gui/edittext.py +++ b/LunaTranslator/LunaTranslator/gui/edittext.py @@ -104,11 +104,11 @@ class ctrlenter(QPlainTextEdit): enterpressed = pyqtSignal() def keyPressEvent(self, e): - if e.key() == Qt.Key_Return or e.key() == Qt.Key_Enter: + if e.key() == Qt.Key.Key_Return or e.key() == Qt.Key.Key_Enter: if ( - e.modifiers() == Qt.ControlModifier - or e.modifiers() == Qt.ShiftModifier - or e.modifiers() == Qt.AltModifier + e.modifiers() == Qt.KeyboardModifier.ControlModifier + or e.modifiers() == Qt.KeyboardModifier.ShiftModifier + or e.modifiers() == Qt.KeyboardModifier.AltModifier ): self.insertPlainText("\n") else: