From a2b07fd97f0fac63fd7a0ed7b1eb0692b3efab71 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Tue, 13 Aug 2019 20:13:19 +0200 Subject: [PATCH] Reverted change of last pull request because it broke ElidingLabel on Windows --- src/ElidingLabel.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ElidingLabel.cpp b/src/ElidingLabel.cpp index 4849da0..8e6ea56 100644 --- a/src/ElidingLabel.cpp +++ b/src/ElidingLabel.cpp @@ -157,11 +157,7 @@ QSize CElidingLabel::minimumSizeHint() const return QLabel::minimumSizeHint(); } const QFontMetrics &fm = fontMetrics(); - #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) - QSize size(fm.horizontalAdvance(d->Text), QLabel::sizeHint().height()); - #else - QSize size(fm.width(d->Text), QLabel::sizeHint().height()); - #endif + QSize size(fm.width(d->Text.left(2) + "…"), fm.height()); return size; } @@ -174,11 +170,7 @@ QSize CElidingLabel::sizeHint() const return QLabel::sizeHint(); } const QFontMetrics& fm = fontMetrics(); - #if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) - QSize size(fm.horizontalAdvance(d->Text), QLabel::sizeHint().height()); - #else - QSize size(fm.width(d->Text), QLabel::sizeHint().height()); - #endif + QSize size(fm.width(d->Text), QLabel::sizeHint().height()); return size; }