setDefaultTextColor (col) "Sets the color for unformatted text in col." The documentation is not clear what “unformatted text” means. I think this means: "all parts of the contents of the subject that were not written."
Content is a QTextDocument.
You create part of the document using QTextCursor. You cannot style QTextDocument as such, but only the part selected by QTextCursor (but you can select the entire document.)
You can create a QTextCursor using the mergeCharFormat (QTextCharFormat) method
QTextCharFormat has methods:
- foreground (). setColor (QColor)
- setForeground (QBrush)
- setTextOutline (QPen)
Foreground is a QBrush that draws a few things, including “text” (but better said: padding characters?)
One caveat is that some recently built QBrush have (by default) QBrushStyle.NoBrush, which is transparent even if you set Color ().
bootchk
source share