Browse Source

Migrate away from deprecated function

`QStyle::standardPixmap()` is deprecated.

PR #19660.
adaptive-webui-19844
Chocobo1 1 year ago committed by GitHub
parent
commit
0404ff9fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/gui/statusbar.cpp
  2. 2
      src/gui/statusbar.h

8
src/gui/statusbar.cpp

@ -158,12 +158,14 @@ void StatusBar::showRestartRequired() @@ -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);
}

2
src/gui/statusbar.h

@ -38,7 +38,7 @@ namespace BitTorrent @@ -38,7 +38,7 @@ namespace BitTorrent
struct SessionStatus;
}
class StatusBar : public QStatusBar
class StatusBar final : public QStatusBar
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(StatusBar)

Loading…
Cancel
Save