What you want is a rich
text edit. Luckily QTextEdit
is able to handle that. Check the acceptRichText property (which should be true
by default).
Then the methods you're looking for are:
Then, instead of appendPlainText()
you should use append()
to add text to the QTextEdit
. Also see this Q/A. As proposed in the accepted answer, you can also use html formatted text instead.