Fix build and deprecation warnings with Qt 5.14

Change-Id: I1fa6b5d3105288d25717a9fe4ae93ad3f471aaca
Reviewed-on: https://code.wireshark.org/review/35727
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Orgad Shaneh 2020-01-10 09:34:20 +02:00 committed by Roland Knall
parent 507bec0f36
commit bc8140be0b
5 changed files with 10 additions and 17 deletions

View File

@ -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<QBrush>();
selected.setColor(ColorUtils::themeLinkBrush().color());
return selected;
}
} else if (role == Qt::TextColorRole) {
return QApplication::palette().link().color();
}
QBrush selected = result.value<QBrush>();
selected.setColor(ColorUtils::themeLinkBrush().color());
return selected;
}
return result;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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();