From eae06b0ccdf72bc2a09457e588fd42d5ab40dc28 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 6 Oct 2022 11:42:18 +0200 Subject: Port from qAsConst() to std::as_const() We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Id6b89c20f706350dbc632e1b48505cafc4cdbafb Reviewed-by: Fabian Kosmale --- src/svg/qsvggenerator.cpp | 2 +- src/svg/qsvghandler.cpp | 2 +- src/svg/qsvgstructure.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index f641912..5dab5b7 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -287,7 +287,7 @@ public: } } - for (const QGradientStop &stop : qAsConst(stops)) { + for (const QGradientStop &stop : std::as_const(stops)) { const QString color = stop.second.name(QColor::HexRgb); str << QLatin1String(" parent(); if (!parent) continue; diff --git a/src/svg/qsvgstructure.cpp b/src/svg/qsvgstructure.cpp index 5ab1978..b4ac368 100644 --- a/src/svg/qsvgstructure.cpp +++ b/src/svg/qsvgstructure.cpp @@ -328,7 +328,7 @@ QRectF QSvgStructureNode::bounds(QPainter *p, QSvgExtraStates &states) const QRectF bounds; if (!m_recursing) { QScopedValueRollback guard(m_recursing, true); - for (QSvgNode *node : qAsConst(m_renderers)) + for (QSvgNode *node : std::as_const(m_renderers)) bounds |= node->transformedBounds(p, states); } return bounds; -- cgit v1.2.1