summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-11-11 16:26:04 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-11-15 14:24:51 +0100
commit4d28f21cc7b6f022f1d5ec742eb17542a0708f58 (patch)
tree6053b5a213ddeb5af3cf7a23ce55c9a334a7fd74
parent49f57b3ad7335881213d3eb66f40035a01c4610d (diff)
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. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I655bbae6b8c089e9f7518a98c6c2fc4a3f342a5c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/bodymovin/bmbase.cpp8
-rw-r--r--src/imports/rasterrenderer/batchrenderer.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/bodymovin/bmbase.cpp b/src/bodymovin/bmbase.cpp
index af7f475..b659261 100644
--- a/src/bodymovin/bmbase.cpp
+++ b/src/bodymovin/bmbase.cpp
@@ -49,7 +49,7 @@ void BMBase::setName(const QString &name)
bool BMBase::setProperty(BMLiteral::PropertyType propertyName, QVariant value)
{
- for (BMBase *child : qAsConst(m_children)) {
+ for (BMBase *child : std::as_const(m_children)) {
bool changed = child->setProperty(propertyName, value);
if (changed)
return true;
@@ -83,7 +83,7 @@ BMBase *BMBase::findChild(const QString &childName)
return this;
BMBase *found = nullptr;
- for (BMBase *child : qAsConst(m_children)) {
+ for (BMBase *child : std::as_const(m_children)) {
found = child->findChild(childName);
if (found)
break;
@@ -96,7 +96,7 @@ void BMBase::updateProperties(int frame)
if (m_hidden)
return;
- for (BMBase *child : qAsConst(m_children))
+ for (BMBase *child : std::as_const(m_children))
child->updateProperties(frame);
}
@@ -106,7 +106,7 @@ void BMBase::render(LottieRenderer &renderer) const
return;
renderer.saveState();
- for (BMBase *child : qAsConst(m_children)) {
+ for (BMBase *child : std::as_const(m_children)) {
if (child->m_hidden)
continue;
child->render(renderer);
diff --git a/src/imports/rasterrenderer/batchrenderer.cpp b/src/imports/rasterrenderer/batchrenderer.cpp
index 5e09e60..d83eb70 100644
--- a/src/imports/rasterrenderer/batchrenderer.cpp
+++ b/src/imports/rasterrenderer/batchrenderer.cpp
@@ -43,7 +43,7 @@ BatchRenderer::~BatchRenderer()
{
QMutexLocker mlocker(&m_mutex);
- for (Entry *entry : qAsConst(m_animData)) {
+ for (Entry *entry : std::as_const(m_animData)) {
qDeleteAll(entry->frameCache);
delete entry->bmTreeBlueprint;
delete entry;
@@ -203,7 +203,7 @@ void BatchRenderer::run()
while (!isInterruptionRequested()) {
QMutexLocker mlocker(&m_mutex);
- for (Entry *e : qAsConst(m_animData))
+ for (Entry *e : std::as_const(m_animData))
prerender(e);
m_waitCondition.wait(&m_mutex);