From 41fd72c815db81fa4ddb1ba4a8bed9e6e4efa00b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 9 Feb 2022 17:13:03 -0800 Subject: [PATCH] Qt6: small API changes A member function had a minute name change. The SceneGraphBackend is now set via a string argument, not a magic constant. Thankfully that appears to be backwards compatible. Signed-off-by: Dirk Hohndel --- stats/statsview.cpp | 8 ++++++++ stats/statsview.h | 4 ++++ subsurface-desktop-main.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/stats/statsview.cpp b/stats/statsview.cpp index 84ed7d402..cd1cc7591 100644 --- a/stats/statsview.cpp +++ b/stats/statsview.cpp @@ -309,14 +309,22 @@ QRectF StatsView::plotArea() const return plotRect; } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +void StatsView::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) +#else void StatsView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) +#endif { plotRect = QRectF(QPointF(0.0, 0.0), newGeometry.size()); backgroundDirty = true; plotAreaChanged(plotRect.size()); // Do we need to call the base-class' version of geometryChanged? Probably for QML? +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QQuickItem::geometryChange(newGeometry, oldGeometry); +#else QQuickItem::geometryChanged(newGeometry, oldGeometry); +#endif } void StatsView::plotAreaChanged(const QSizeF &s) diff --git a/stats/statsview.h b/stats/statsview.h index 11a155156..938e81e29 100644 --- a/stats/statsview.h +++ b/stats/statsview.h @@ -77,7 +77,11 @@ private: QRectF plotRect; QSGNode *updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *updatePaintNodeData) override; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; +#else void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; +#endif void plotAreaChanged(const QSizeF &size); void reset(); // clears all series and axes void setAxes(StatsAxis *x, StatsAxis *y); diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp index bb203e21c..1bf044552 100644 --- a/subsurface-desktop-main.cpp +++ b/subsurface-desktop-main.cpp @@ -204,7 +204,7 @@ exit: surface.destroy(); if (glError) { qWarning() << QStringLiteral(VALIDATE_GL_PREFIX "WARNING: %1. Using a software renderer!").arg(glError); - QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); + QQuickWindow::setSceneGraphBackend("software"); } }