Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.13.2, 5.14.0 Beta3
-
-
a1f4321bbba2f3bff24d753ce766be738dbfa61a (qt/qtbase/5.14)
Description
If a QTextDocument is given html content, attempting to change the font family by calling QTextCursor::mergeCharFormat fails consistently in changing the family if the QTextCharFormat passed as an argument has a default QFont and the font family is set by calling QTextCharFormat::setFontFamily.
The issue is fixed by calling QTextCharFormat::setFont before passing it to mergeCharFormat.
Steps to reproduce:
- Run the attached project
- The sample project will attempt to change the font to jokerman
- Monitor the output html => the span containing "Hello world" will have a wrong font family set
- (optional) Pass "-workaround" as an arg to apply workaround for comparison.
Note: This problem does not appear in Qt 5.12.