PyQt5 QTextEdit 去除粘贴格式
2019-10-02 python 2256
class ActionText(QTextEdit): isEdit = False def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.signal = Signal() def mouseReleaseEvent(self, event): if self.isEdit == False: textCursor = self.textCursor() index = textCursor.position() # self.action_text.find(txt, QTextDocument.FindWholeWords) self.signal.indexTrigger.emit(index) def setColumnPos(self, index): textCursor = self.action_text.textCursor() textCursor.select(QTextCursor.LineUnderCursor) self.action_text.setTextCursor(textCursor) def insertFromMimeData(self, soc): if soc.hasText(): self.textCursor().insertText(soc.text()) #去除粘贴格式
很赞哦! (0)
相关文章
文章评论
-
-
-
0条评论