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.
Attachments
For Gerrit Dashboard: QTBUG-80475 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
283543,3 | QTextDocument: Give fontFamily() precedence over fontFamilies() | 5.14 | qt/qtbase | Status: MERGED | +2 | 0 |
285519,2 | QTextDocument: Set the font family to be after the families set | 5.14 | qt/qtbase | Status: MERGED | +2 | 0 |
285548,2 | QTextDocument: Give fontFamily() precedence over fontFamilies() | 5.15 | qt/qtbase | Status: MERGED | 0 | 0 |