summary refs log tree commit diff
path: root/src/ui/InfoMessage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-26 13:55:51 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-26 18:59:20 +0200
commite8e48305c8322c58cef88bf8c23d7972d941d7f4 (patch)
tree9de982f6740eba9cf7d100971173792933c8ae11 /src/ui/InfoMessage.cpp
parentRemove QML from format script (it causes too many issues) (diff)
downloadnheko-e8e48305c8322c58cef88bf8c23d7972d941d7f4.tar.xz
Remove version checks for unsupported Qt versions
Diffstat (limited to 'src/ui/InfoMessage.cpp')
-rw-r--r--src/ui/InfoMessage.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/ui/InfoMessage.cpp b/src/ui/InfoMessage.cpp

index fb3b306a..ebe0e63f 100644 --- a/src/ui/InfoMessage.cpp +++ b/src/ui/InfoMessage.cpp
@@ -29,13 +29,7 @@ InfoMessage::InfoMessage(QString msg, QWidget *parent) initFont(); QFontMetrics fm{font()}; -#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) - // width deprecated in 5.13 - width_ = fm.width(msg_) + HPadding * 2; -#else - width_ = fm.horizontalAdvance(msg_) + HPadding * 2; -#endif - + width_ = fm.horizontalAdvance(msg_) + HPadding * 2; height_ = fm.ascent() + 2 * VPadding; setFixedHeight(height_ + 2 * HMargin); @@ -77,12 +71,7 @@ DateSeparator::DateSeparator(QDateTime datetime, QWidget *parent) msg_ = datetime.date().toString(fmt); QFontMetrics fm{font()}; -#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) - // width deprecated in 5.13 - width_ = fm.width(msg_) + HPadding * 2; -#else - width_ = fm.horizontalAdvance(msg_) + HPadding * 2; -#endif + width_ = fm.horizontalAdvance(msg_) + HPadding * 2; height_ = fm.ascent() + 2 * VPadding; setFixedHeight(height_ + 2 * HMargin);