Reverted change of last pull request because it broke ElidingLabel on Windows

This commit is contained in:
Uwe Kindler 2019-08-13 20:13:19 +02:00
parent 078905181e
commit a2b07fd97f

View File

@ -157,11 +157,7 @@ QSize CElidingLabel::minimumSizeHint() const
return QLabel::minimumSizeHint(); return QLabel::minimumSizeHint();
} }
const QFontMetrics &fm = fontMetrics(); const QFontMetrics &fm = fontMetrics();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) QSize size(fm.width(d->Text.left(2) + ""), fm.height());
QSize size(fm.horizontalAdvance(d->Text), QLabel::sizeHint().height());
#else
QSize size(fm.width(d->Text), QLabel::sizeHint().height());
#endif
return size; return size;
} }
@ -174,11 +170,7 @@ QSize CElidingLabel::sizeHint() const
return QLabel::sizeHint(); return QLabel::sizeHint();
} }
const QFontMetrics& fm = fontMetrics(); const QFontMetrics& fm = fontMetrics();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) QSize size(fm.width(d->Text), QLabel::sizeHint().height());
QSize size(fm.horizontalAdvance(d->Text), QLabel::sizeHint().height());
#else
QSize size(fm.width(d->Text), QLabel::sizeHint().height());
#endif
return size; return size;
} }