mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-21 12:28:26 -04:00
Fix ElidedLabel when Font size is not defined.
This commit is contained in:
parent
28017566f1
commit
3540b1ae38
2 changed files with 5 additions and 7 deletions
|
@ -128,6 +128,7 @@ bool ElidedLabel::paintElidedLine( QPainter* painter, QString plainText
|
|||
|
||||
if (painter)
|
||||
{
|
||||
useFont.setPointSize(useFont.pointSize()); //Modify it to be copied in painter. Else painter keep defaut font size.
|
||||
painter->save();
|
||||
painter->setFont(useFont);
|
||||
}
|
||||
|
@ -152,7 +153,7 @@ bool ElidedLabel::paintElidedLine( QPainter* painter, QString plainText
|
|||
QTextLine lineEnd = textLayout.createLine();
|
||||
if (!lineEnd.isValid() && (wordWrap
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,11,0)
|
||||
|| (fontMetrics.width(lastLine) < cr.width()) ))
|
||||
|| (fontMetrics.width(lastLine) < cr.width()) ))
|
||||
#else
|
||||
|| (fontMetrics.horizontalAdvance(lastLine) < cr.width()) ))
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue