diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp index a90d03b010..756b6b28be 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp @@ -114,7 +114,7 @@ void QV4DebuggerAgent::addDebugger(QV4Debugger *debugger) debugger->setBreakOnThrow(m_breakOnThrow); - foreach (const BreakPoint &breakPoint, m_breakPoints.values()) + for (const BreakPoint &breakPoint : qAsConst(m_breakPoints)) if (breakPoint.enabled) debugger->addBreakPoint(breakPoint.fileName, breakPoint.lineNr, breakPoint.condition); diff --git a/src/quick/items/qquickshadereffectnode.cpp b/src/quick/items/qquickshadereffectnode.cpp index 246a713dca..5572a36602 100644 --- a/src/quick/items/qquickshadereffectnode.cpp +++ b/src/quick/items/qquickshadereffectnode.cpp @@ -455,7 +455,7 @@ void QQuickShaderEffectMaterial::cleanupMaterialCache() { QQuickShaderEffectMaterialCache *cache = QQuickShaderEffectMaterialCache::get(false); if (cache) { - qDeleteAll(cache->cache.values()); + qDeleteAll(cache->cache); delete cache; } } diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index d91004fbee..db17d572b6 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -845,7 +845,7 @@ Renderer::~Renderer() for (int i=0; i cachedData = m_cache.values(); - // Prevent unreferencePixmap() from assuming it needs to kick // off the cache expiry timer, as we're shrinking the cache // manually below after releasing all the pixmaps. m_timerId = -2; // unreference all (leaked) pixmaps - foreach (QQuickPixmapData* pixmap, cachedData) { + for (auto *pixmap : qAsConst(m_cache)) { int currRefCount = pixmap->refCount; if (currRefCount) { #ifndef QT_NO_DEBUG diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index d4956983fb..569cb37c95 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -392,7 +392,7 @@ QQuickSmoothedAnimationPrivate::~QQuickSmoothedAnimationPrivate() void QQuickSmoothedAnimationPrivate::updateRunningAnimations() { - foreach(QSmoothedAnimation* ease, activeAnimations.values()){ + for (QSmoothedAnimation *ease : qAsConst(activeAnimations)) { ease->maximumEasingTime = anim->maximumEasingTime; ease->reversingMode = anim->reversingMode; ease->velocity = anim->velocity; @@ -444,7 +444,8 @@ QAbstractAnimationJob* QQuickSmoothedAnimation::transition(QQuickStateActions &a anims.insert(ease); } - foreach (QSmoothedAnimation *ease, d->activeAnimations.values()){ + const auto copy = d->activeAnimations; + for (QSmoothedAnimation *ease : copy) { if (!anims.contains(ease)) { ease->clearTemplate(); d->activeAnimations.remove(ease->target); diff --git a/src/quick/util/qquickspringanimation.cpp b/src/quick/util/qquickspringanimation.cpp index df077350e9..d2bc3b4ece 100644 --- a/src/quick/util/qquickspringanimation.cpp +++ b/src/quick/util/qquickspringanimation.cpp @@ -585,7 +585,8 @@ QAbstractAnimationJob* QQuickSpringAnimation::transition(QQuickStateActions &act animation->restart(); anims.insert(animation); } - foreach (QSpringAnimation *anim, d->activeAnimations.values()){ + const auto copy = d->activeAnimations; + for (QSpringAnimation *anim : copy) { if (!anims.contains(anim)) { anim->clearTemplate(); d->activeAnimations.remove(anim->target);