summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3drender/items/quick3deffect.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-29 01:01:50 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-05-14 16:02:31 +0000
commit6cbe56dfec652d24678aeec069a22f95eb83aa2b (patch)
treec6d1d828ef858d050aa71d07366d450ebda85f9b /src/quick3d/quick3drender/items/quick3deffect.cpp
parentafc5426d4a1b22df72e4cf5582c390d774768673 (diff)
quick3d: eradicate Q_FOREACH loops [low-risk]
... by replacing them with C++11 range-for loops. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Sprinkled in a reserve() or two. Change-Id: I5a3da485213791ae58c82f4a81829cfba558a3d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d/quick3drender/items/quick3deffect.cpp')
-rw-r--r--src/quick3d/quick3drender/items/quick3deffect.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick3d/quick3drender/items/quick3deffect.cpp b/src/quick3d/quick3drender/items/quick3deffect.cpp
index eb8a7f8f1..9d4ce934a 100644
--- a/src/quick3d/quick3drender/items/quick3deffect.cpp
+++ b/src/quick3d/quick3drender/items/quick3deffect.cpp
@@ -99,7 +99,8 @@ void Quick3DEffect::clearTechniqueList(QQmlListProperty<QTechnique> *list)
if (eff) {
// Ownership of techniques is handled by the QmlEngine so we shouldn't class clearTechniques
// which deletes techniques
- Q_FOREACH (QTechnique *tech, eff->parentEffect()->techniques())
+ const auto techniques = eff->parentEffect()->techniques();
+ for (QTechnique *tech : techniques)
eff->parentEffect()->removeTechnique(tech);
}
}
@@ -125,7 +126,8 @@ int Quick3DEffect::parametersCount(QQmlListProperty<QParameter> *list)
void Quick3DEffect::clearParameterList(QQmlListProperty<QParameter> *list)
{
Quick3DEffect *effect = qobject_cast<Quick3DEffect *>(list->object);
- Q_FOREACH (QParameter *p, qobject_cast<QEffect *>(effect->parentEffect())->parameters())
+ const auto parameters = qobject_cast<QEffect *>(effect->parentEffect())->parameters();
+ for (QParameter *p : parameters)
qobject_cast<QEffect *>(effect->parentEffect())->removeParameter(p);
}