\reentrant \inmodule QtGui
QTextCharFormat charFormat() const
Returns the format of the character immediately before the cursor position().
void setCharFormat(const QTextCharFormat &format)
Sets the cursor's current character format to the given format.
void insertText(const QString &text)
Inserts text at the current position, using the current character format.
\reentrant \inmodule QtGui
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
QTextDocument * document
the underlying document of the text editor.