When QFontMetrics::boundingRect().width was replaced with QFontMetrics::horizontalAdvance() in
76a46fd9094b17eb99e8a42cca8562fdc0b3814c, an extra line (formerly introduced by
a203c271161ce953354b9e0722492605a4d17415) was changed as well.
Unfortunately, boundingRect().width is the correct function to use for calculating the size of the last line, while horizontalAdvance would be correct if we were laying it next to the previous line instead of below the previous line.
BUG: 432530
const QString elidedText = nameText.left(line.textStart()) + lastTextLine;
nameTextInfo->staticText.setText(elidedText);
- lastLineWidth = m_customizedFontMetrics.horizontalAdvance(lastTextLine);
+ lastLineWidth = m_customizedFontMetrics.boundingRect(lastTextLine).width();
// We do the text eliding in a loop with decreasing width (1 px / iteration)
// to avoid problems related to different width calculation code paths