diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp index 598b2bd0c3725c12b51cfeeba6c3bd8d31caf092..2809de87ac6e0ebade8502e400e149d0c3e4cb52 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp @@ -295,12 +295,9 @@ operator<<(QDBusArgument &arg, const QImage &image) int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3); arg << i.depth() / channels; arg << channels; -#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) - arg << QByteArray(reinterpret_cast<const char *>(i.bits()), i.byteCount()); -#else arg << QByteArray(reinterpret_cast<const char *>(i.bits()), i.sizeInBytes()); -#endif arg.endStructure(); + return arg; } diff --git a/src/ui/InfoMessage.cpp b/src/ui/InfoMessage.cpp index fb3b306a0ffb76d942733a76628d66abba7e8d10..ebe0e63fb19e57d64bd301309844be9931bd3303 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); diff --git a/src/ui/Painter.h b/src/ui/Painter.h index 3353f0c76cbbfa141f9b4ced6e8dd844d6098b57..9f97411676c203aca97244a4068b755245198099 100644 --- a/src/ui/Painter.h +++ b/src/ui/Painter.h @@ -27,12 +27,7 @@ public: { QFontMetrics m(fontMetrics()); if (textWidth < 0) { -#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) - // deprecated in 5.13: - textWidth = m.width(text); -#else textWidth = m.horizontalAdvance(text); -#endif } drawText((outerw - x - textWidth), y + m.ascent(), text); }