From 7427fc4bdbcdf109e2403145134a8f42b26f8c68 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: Tue, 3 Sep 2024 08:42:01 +0800 Subject: [PATCH] Update edittext.py --- LunaTranslator/LunaTranslator/gui/edittext.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/edittext.py b/LunaTranslator/LunaTranslator/gui/edittext.py index 4a181654..cd1cdeab 100644 --- a/LunaTranslator/LunaTranslator/gui/edittext.py +++ b/LunaTranslator/LunaTranslator/gui/edittext.py @@ -4,7 +4,7 @@ import gobject, qtawesome from myutils.config import globalconfig from myutils.wrapper import Singleton_close from gui.usefulwidget import saveposwindow, getsimplecombobox -from gui.dynalang import LPushButton, LMainWindow, LAction +from gui.dynalang import LPushButton, LMainWindow @Singleton_close @@ -30,11 +30,6 @@ class edittext(saveposwindow): self.textOutput = QPlainTextEdit(self) - self.textOutput.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) - - self.textOutput.customContextMenuRequested.connect(self.showmenu) - # self.setCentralWidget(self.textOutput) - self.textOutput.setUndoRedoEnabled(True) self.textOutput.setReadOnly(False) @@ -87,14 +82,6 @@ class edittext(saveposwindow): ) ) - def showmenu(self, point: QPoint): - menu = QMenu(self.textOutput) - qingkong = LAction(("清空")) - menu.addAction(qingkong) - action = menu.exec(QCursor.pos()) - if action == qingkong: - self.textOutput.clear() - def getnewsentence(self, sentence): if gobject.baseobject.edittextui_sync: self.textOutput.setPlainText(sentence)