From 0404ff9fb3f0d19e47bf0b241a58e2af3934d07e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 30 Sep 2023 11:43:11 +0800 Subject: [PATCH] Migrate away from deprecated function `QStyle::standardPixmap()` is deprecated. PR #19660. --- src/gui/statusbar.cpp | 8 +++++--- src/gui/statusbar.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/statusbar.cpp b/src/gui/statusbar.cpp index 82bf2bb7e..8eef15e7b 100644 --- a/src/gui/statusbar.cpp +++ b/src/gui/statusbar.cpp @@ -158,12 +158,14 @@ void StatusBar::showRestartRequired() { // Restart required notification const QString restartText = tr("qBittorrent needs to be restarted!"); - QLabel *restartIconLbl = new QLabel(this); - restartIconLbl->setPixmap(style()->standardPixmap(QStyle::SP_MessageBoxWarning)); + + const QPixmap pixmap = style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(Utils::Gui::smallIconSize()); + auto *restartIconLbl = new QLabel(this); + restartIconLbl->setPixmap(pixmap); restartIconLbl->setToolTip(restartText); insertWidget(0, restartIconLbl); - QLabel *restartLbl = new QLabel(this); + auto *restartLbl = new QLabel(this); restartLbl->setText(restartText); insertWidget(1, restartLbl); } diff --git a/src/gui/statusbar.h b/src/gui/statusbar.h index 3d9354faf..be5f993d0 100644 --- a/src/gui/statusbar.h +++ b/src/gui/statusbar.h @@ -38,7 +38,7 @@ namespace BitTorrent struct SessionStatus; } -class StatusBar : public QStatusBar +class StatusBar final : public QStatusBar { Q_OBJECT Q_DISABLE_COPY_MOVE(StatusBar)