你好我的PyQT QTextEdit遇到了一个相当奇怪的问题.当我从我的QLineEdit输入一个字符串时,它会添加它但是说我输入另一个字符串消失了我假设那是因为我没有附加文本.知道我怎么能这样做吗?
这是相关的代码
self.mytext.setText(str(self.user) + ": " + str(self.line.text()) + "\n")
而重要的一个
self.mySignal.emit(self.decrypt_my_message(str(msg)).strip() + "\n")
编辑*
我想通了我需要使用QTextCursor
self.cursor = QTextCursor(self.mytext.document())
self.cursor.insertText(str(self.user) + ": " + str(self.line.text()) + "\n")
*干杯