When a user activates the boldAction for example, the code was replacing
QTextCharFormat's font with a default-constructed font that has the bold
attribute set, which meant that it could not be bold, italic, underlined
struck out, and with a custom size and color at the same time. On the
other hand, when we do it the current way:
textArea.cursorSelection.font.bold = checked
we call QQuickTextSelection::font(), QFont::setBold(), and then
QQuickTextSelection::setFont(). (QFont is a QML value type, so it's the
only way.) Perhaps at some point, something was going wrong with that,
but it seems to work now.
Amends 045f9ce192
Fixes: QTBUG-136250
Pick-to: 6.8 6.9
Change-Id: I268e5814e7aa52aeb5aaec2d1a8fbfbc0d670236
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>