Update edittext.py

This commit is contained in:
恍兮惚兮 2024-09-03 08:42:01 +08:00
parent 50ee6c735f
commit 7427fc4bdb

View File

@ -4,7 +4,7 @@ import gobject, qtawesome
from myutils.config import globalconfig from myutils.config import globalconfig
from myutils.wrapper import Singleton_close from myutils.wrapper import Singleton_close
from gui.usefulwidget import saveposwindow, getsimplecombobox from gui.usefulwidget import saveposwindow, getsimplecombobox
from gui.dynalang import LPushButton, LMainWindow, LAction from gui.dynalang import LPushButton, LMainWindow
@Singleton_close @Singleton_close
@ -30,11 +30,6 @@ class edittext(saveposwindow):
self.textOutput = QPlainTextEdit(self) 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.setUndoRedoEnabled(True)
self.textOutput.setReadOnly(False) 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): def getnewsentence(self, sentence):
if gobject.baseobject.edittextui_sync: if gobject.baseobject.edittextui_sync:
self.textOutput.setPlainText(sentence) self.textOutput.setPlainText(sentence)