diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:42:18 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 14:37:28 +0200 |
commit | eae06b0ccdf72bc2a09457e588fd42d5ab40dc28 (patch) | |
tree | 0ac857d486688ba2d821a0126cc2c2eba8ceb808 /src | |
parent | dd15658245e36c764964397d64120bc26607787a (diff) | |
download | qtsvg-eae06b0ccdf72bc2a09457e588fd42d5ab40dc28.tar.gz |
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvggenerator.cpp | 2 | ||||
-rw-r--r-- | src/svg/qsvghandler.cpp | 2 | ||||
-rw-r--r-- | src/svg/qsvgstructure.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
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(" <stop offset=\"")<< stop.first << QLatin1String("\" ") << QLatin1String("stop-color=\"") << color << QLatin1String("\" ") diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 09da1a3..29ca733 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3891,7 +3891,7 @@ void QSvgHandler::resolveGradients(QSvgNode *node, int nestedDepth) void QSvgHandler::resolveNodes() { - for (QSvgUse *useNode : qAsConst(m_toBeResolved)) { + for (QSvgUse *useNode : std::as_const(m_toBeResolved)) { const auto parent = useNode->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<bool> 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; |