From bc8140be0bc9dc06e64db3a69b1eb6fa3a0de3a7 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Fri, 10 Jan 2020 09:34:20 +0200 Subject: Fix build and deprecation warnings with Qt 5.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1fa6b5d3105288d25717a9fe4ae93ad3f471aaca Reviewed-on: https://code.wireshark.org/review/35727 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- ui/qt/models/astringlist_list_model.cpp | 17 +++++------------ ui/qt/models/profile_model.cpp | 2 +- ui/qt/widgets/qcustomplot.cpp | 4 ++-- ui/qt/widgets/splash_overlay.cpp | 2 +- ui/qt/wireshark_application.cpp | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/ui/qt/models/astringlist_list_model.cpp b/ui/qt/models/astringlist_list_model.cpp index 9d91fea9b3..2a66071949 100644 --- a/ui/qt/models/astringlist_list_model.cpp +++ b/ui/qt/models/astringlist_list_model.cpp @@ -266,19 +266,12 @@ QVariant AStringListListUrlProxyModel::data(const QModelIndex &index, int role) { QVariant result = QIdentityProxyModel::data(index, role); - if (urls_.contains(index.column())) + if (role == Qt::ForegroundRole && urls_.contains(index.column()) + && result.canConvert(QVariant::Brush)) { - if (role == Qt::ForegroundRole) - { - if (result.canConvert(QVariant::Brush)) - { - QBrush selected = result.value(); - selected.setColor(ColorUtils::themeLinkBrush().color()); - return selected; - } - } else if (role == Qt::TextColorRole) { - return QApplication::palette().link().color(); - } + QBrush selected = result.value(); + selected.setColor(ColorUtils::themeLinkBrush().color()); + return selected; } return result; diff --git a/ui/qt/models/profile_model.cpp b/ui/qt/models/profile_model.cpp index ae6284d0b8..68079b1b00 100644 --- a/ui/qt/models/profile_model.cpp +++ b/ui/qt/models/profile_model.cpp @@ -582,7 +582,7 @@ QVariant ProfileModel::data(const QModelIndex &index, int role) const return dataDisplay(index); case Qt::FontRole: return dataFontRole(index); - case Qt::BackgroundColorRole: + case Qt::BackgroundRole: return dataBackgroundRole(index); case Qt::ToolTipRole: return dataToolTipRole(index); diff --git a/ui/qt/widgets/qcustomplot.cpp b/ui/qt/widgets/qcustomplot.cpp index cc29e1db5b..972b613886 100644 --- a/ui/qt/widgets/qcustomplot.cpp +++ b/ui/qt/widgets/qcustomplot.cpp @@ -657,7 +657,7 @@ QCPPaintBufferPixmap::~QCPPaintBufferPixmap() QCPPainter *QCPPaintBufferPixmap::startPainting() { QCPPainter *result = new QCPPainter(&mBuffer); - result->setRenderHint(QPainter::HighQualityAntialiasing); + result->setRenderHint(QPainter::Antialiasing); return result; } @@ -14738,7 +14738,7 @@ void QCustomPlot::paintEvent(QPaintEvent *event) QCPPainter painter(this); if (painter.isActive()) { - painter.setRenderHint(QPainter::HighQualityAntialiasing); // to make Antialiasing look good if using the OpenGL graphicssystem + painter.setRenderHint(QPainter::Antialiasing); // to make Antialiasing look good if using the OpenGL graphicssystem if (mBackgroundBrush.style() != Qt::NoBrush) painter.fillRect(mViewport, mBackgroundBrush); drawBackground(&painter); diff --git a/ui/qt/widgets/splash_overlay.cpp b/ui/qt/widgets/splash_overlay.cpp index 0ba729f0bd..92761d4344 100644 --- a/ui/qt/widgets/splash_overlay.cpp +++ b/ui/qt/widgets/splash_overlay.cpp @@ -55,7 +55,7 @@ SplashOverlay::SplashOverlay(QWidget *parent) : QColor bg = QColor(tango_aluminium_6); bg.setAlphaF(0.2); QPalette pal; - pal.setColor(QPalette::Background, bg); + pal.setColor(QPalette::Window, bg); setPalette(pal); setAutoFillBackground(true); diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp index eb56e2f167..bbf2b9c25d 100644 --- a/ui/qt/wireshark_application.cpp +++ b/ui/qt/wireshark_application.cpp @@ -616,7 +616,7 @@ void WiresharkApplication::checkForDbar() // We have a list of context menu handler CLSIDs. Now look for // offending DLLs. - foreach (QString clsid, clsids.toList()) { + foreach (QString clsid, clsids.values()) { QString inproc_path = QString("HKEY_CLASSES_ROOT\\CLSID\\%1\\InprocServer32").arg(clsid); QSettings inproc_reg(inproc_path, QSettings::NativeFormat); QString inproc_default = inproc_reg.value(".").toString(); -- cgit v1.2.3