Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.0.0
-
None
Description
Discovered while investigating while fixing QTBUG-80554.
When calculating the content height of a QTextDocument, the layout uses the y coordinate already found for the "next" line (plus margins). If the font has a positive leading value, this will be included, which is wrong.
There is negligible effect of this, but it can be seen when checking the height of a QLabel with/without TextSelectableByMouse set (like in tst_QLabel::sizeHint()). One uses qt_format_text() to calculate the height, whereas the other goes via a QTextDocument. If the font has a positive leading, then the text document height may be > the other one if the ceil(ascent + descent) is lower than ceil(ascent + descent + leading).
The remedy for QTBUG-80554 triggered a failure in tst_QLabel::sizeHint() on some platforms.