Qt5's documentation doesn't mention that QPlainTextEdit
has setText(QString)
like QTextEdit
does. But, I don't think it's impossible. The only way I found is to use QTextDocument
which can has setPlainText(const QString& text)
. So I have to do this:
plain_text_edit->setDocument(text_document);
The problem is text_document
should be a pointer. Not like QTextEdit
's setText
which can take a local variable as it's parameter. So, is there anyway to do setText
like to QPlainTextEdit
?