From 72d31c568ec5047d04fb13bbb6ba4b3954308ef9 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 25 Jun 2019 14:00:09 +0200 Subject: [PATCH] Don't use functions obsoleted in Qt 5.13.0 --- gui/dbquerywidget.cpp | 4 ++-- gui/notificationlabel.cpp | 4 ++-- gui/picturepreviewselection.cpp | 2 +- gui/tagedit.cpp | 6 +++--- misc/htmlinfo.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gui/dbquerywidget.cpp b/gui/dbquerywidget.cpp index f971ca4..b26f4dc 100644 --- a/gui/dbquerywidget.cpp +++ b/gui/dbquerywidget.cpp @@ -588,7 +588,7 @@ void DbQueryWidget::showCover(const QByteArray &data) dlg.setWindowFlags(Qt::Tool); dlg.setWindowTitle(tr("Cover - %1").arg(QApplication::applicationName())); QBoxLayout layout(QBoxLayout::Up); - layout.setMargin(0); + layout.setContentsMargins(0, 0, 0, 0); QGraphicsView view(&dlg); QGraphicsScene scene; layout.addWidget(&view); @@ -613,7 +613,7 @@ void DbQueryWidget::showLyrics(const QString &data) dlg.setWindowFlags(Qt::Tool); dlg.setWindowTitle(tr("Lyrics - %1").arg(QApplication::applicationName())); QBoxLayout layout(QBoxLayout::Up); - layout.setMargin(0); + layout.setContentsMargins(0, 0, 0, 0); QTextBrowser textBrowser; layout.addWidget(&textBrowser); textBrowser.setText(data); diff --git a/gui/notificationlabel.cpp b/gui/notificationlabel.cpp index 239e9ac..5ec1c03 100644 --- a/gui/notificationlabel.cpp +++ b/gui/notificationlabel.cpp @@ -56,12 +56,12 @@ void NotificationLabel::paintEvent(QPaintEvent *event) switch (m_type) { case NotificationType::Progress: if (m_subject == NotificationSubject::None) { - drawProgressIndicator(painter, pixmapRect, option.palette.color(QPalette::Foreground), m_animationStep); + drawProgressIndicator(painter, pixmapRect, option.palette.color(QPalette::WindowText), m_animationStep); } else { style->drawItemPixmap(&painter, pixmapRect, Qt::AlignTop | Qt::AlignLeft, m_mainPixmap); QSize size = pixmapRect.size() * 0.3; pixmapRect.adjust(size.width(), size.height(), 0, 0); - drawProgressIndicator(painter, pixmapRect, option.palette.color(QPalette::Foreground), m_animationStep); + drawProgressIndicator(painter, pixmapRect, option.palette.color(QPalette::WindowText), m_animationStep); } break; default: diff --git a/gui/picturepreviewselection.cpp b/gui/picturepreviewselection.cpp index e890d47..ebd6eba 100644 --- a/gui/picturepreviewselection.cpp +++ b/gui/picturepreviewselection.cpp @@ -530,7 +530,7 @@ void PicturePreviewSelection::displaySelected() : tr("Cover - %1").arg(QCoreApplication::applicationName()); dlg.setWindowTitle(title); QBoxLayout layout(QBoxLayout::Up); - layout.setMargin(0); + layout.setContentsMargins(0, 0, 0, 0); QGraphicsView view(&dlg); QGraphicsScene scene; layout.addWidget(&view); diff --git a/gui/tagedit.cpp b/gui/tagedit.cpp index e4e7e27..b982fc5 100644 --- a/gui/tagedit.cpp +++ b/gui/tagedit.cpp @@ -31,11 +31,11 @@ namespace QtGui { TagEdit::TagEdit(QWidget *parent) : QWidget(parent) { - QVBoxLayout *const mainLayout = new QVBoxLayout(this); - mainLayout->setMargin(0); + auto *const mainLayout = new QVBoxLayout(this); + mainLayout->setContentsMargins(0, 0, 0, 0); QSplitter *const splitter = new QSplitter(this); splitter->setOrientation(Qt::Horizontal); - QWidget *widget = new QWidget(this); + auto *widget = new QWidget(this); m_layoutLeft = new QFormLayout(widget); m_layoutLeft->setContentsMargins(QMargins()); m_layoutLeft->setSpacing(2); diff --git a/misc/htmlinfo.cpp b/misc/htmlinfo.cpp index d1e2894..d7394e6 100644 --- a/misc/htmlinfo.cpp +++ b/misc/htmlinfo.cpp @@ -347,7 +347,7 @@ public: APPEND_GUI_RULE(QStringLiteral("color: %1;") .arg(palette.link() .color() - .darker(palette.color(QPalette::Background).lightness() > palette.color(QPalette::Link).lightness() ? 150 : 50) + .darker(palette.color(QPalette::Window).lightness() > palette.color(QPalette::Link).lightness() ? 150 : 50) .name()), QStringLiteral("color: #23527c;")) res.append(QStringLiteral("text-decoration: underline;"