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