forked from osmocom/wireshark
qcustomplot: Fix some warnings in upstream code
QPainter::HighQualityAntialiasing is obsolete and ignored (https://doc.qt.io/qt-5/qpainter.html#RenderHint-enum) since at least 5.6, so use Antialiasing instead, as indicated by the docs. (https://doc.qt.io/archives/qt-5.6/qpainter.html#RenderHint-enum) Explicitly cast a long to an int, like already done on line 21080. Put in a break to suppress an overly aggressive fallthrough warning on g++ (all values of an enum are tested, so it cannot actually fall through.)
This commit is contained in:
parent
fe98c68224
commit
d0088585b3
|
@ -673,7 +673,7 @@ QCPPainter *QCPPaintBufferPixmap::startPainting()
|
|||
{
|
||||
QCPPainter *result = new QCPPainter(&mBuffer);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
result->setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
result->setRenderHint(QPainter::Antialiasing);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
@ -762,7 +762,7 @@ QCPPainter *QCPPaintBufferGlPbuffer::startPainting()
|
|||
}
|
||||
|
||||
QCPPainter *result = new QCPPainter(mGlPBuffer);
|
||||
result->setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
result->setRenderHint(QPainter::Antialiasing);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -875,7 +875,7 @@ QCPPainter *QCPPaintBufferGlFbo::startPainting()
|
|||
mGlFrameBuffer->bind();
|
||||
QCPPainter *result = new QCPPainter(paintDevice.data());
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
result->setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
result->setRenderHint(QPainter::Antialiasing);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
@ -5752,6 +5752,8 @@ QPointF QCPLabelPainterPrivate::getAnchorPos(const QPointF &tickPos)
|
|||
case asBottomRight: return tickPos+QPointF(-mPadding*M_SQRT1_2, -mPadding*M_SQRT1_2);
|
||||
case asBottomLeft: return tickPos+QPointF(mPadding*M_SQRT1_2, -mPadding*M_SQRT1_2);
|
||||
}
|
||||
// All 8 enum cases, cannot actually fall through but silence warning
|
||||
break;
|
||||
}
|
||||
case amSkewedUpright:
|
||||
case amSkewedRotated:
|
||||
|
@ -15464,7 +15466,7 @@ void QCustomPlot::paintEvent(QPaintEvent *event)
|
|||
if (painter.isActive())
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
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
|
||||
#endif
|
||||
if (mBackgroundBrush.style() != Qt::NoBrush)
|
||||
painter.fillRect(mViewport, mBackgroundBrush);
|
||||
|
@ -34897,7 +34899,7 @@ double QCPPolarGraph::selectTest(const QPointF &pos, bool onlySelectable, QVaria
|
|||
double result = pointDistance(pos, closestDataPoint);
|
||||
if (details)
|
||||
{
|
||||
int pointIndex = closestDataPoint-mDataContainer->constBegin();
|
||||
int pointIndex = int(closestDataPoint-mDataContainer->constBegin());
|
||||
details->setValue(QCPDataSelection(QCPDataRange(pointIndex, pointIndex+1)));
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue