mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
Update edittext.py
This commit is contained in:
parent
50ee6c735f
commit
7427fc4bdb
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user