diff options
5 files changed, 9 insertions, 7 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp index ea5124edf9..f6898b3879 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalrectanglenode.cpp @@ -117,7 +117,7 @@ void QSGSoftwareInternalRectangleNode::setGradientStops(const QGradientStops &st { //normalize stops bool needsNormalization = false; - foreach (const QGradientStop &stop, stops) { + for (const QGradientStop &stop : qAsConst(stops)) { if (stop.first < 0.0 || stop.first > 1.0) { needsNormalization = true; continue; @@ -274,7 +274,7 @@ bool QSGSoftwareInternalRectangleNode::isOpaque() const if (m_penWidth > 0.0f && m_penColor.alpha() < 255) return false; if (m_stops.count() > 0) { - foreach (QGradientStop stop, m_stops) { + for (const QGradientStop &stop : qAsConst(m_stops)) { if (stop.second.alpha() < 255) return false; } diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 50986e2528..9574f2a48e 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -195,7 +195,7 @@ void QSGDistanceFieldGlyphCache::update() storeGlyphs(distanceFields); #if defined(QSG_DISTANCEFIELD_CACHE_DEBUG) - foreach (Texture texture, m_textures) + for (Texture texture : qAsConst(m_textures)) saveTexture(texture.textureId, texture.size.width(), texture.size.height()); #endif diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp index 8272be987b..6324d84883 100644 --- a/src/quick/scenegraph/qsgdefaultcontext.cpp +++ b/src/quick/scenegraph/qsgdefaultcontext.cpp @@ -155,7 +155,9 @@ void QSGDefaultContext::renderContextInitialized(QSGRenderContext *renderContext qCDebug(QSG_LOG_INFO) << "GL_RENDERER: " << (const char *) funcs->glGetString(GL_RENDERER); qCDebug(QSG_LOG_INFO) << "GL_VERSION: " << (const char *) funcs->glGetString(GL_VERSION); QSet<QByteArray> exts = openglRenderContext->openglContext()->extensions(); - QByteArray all; foreach (const QByteArray &e, exts) all += ' ' + e; + QByteArray all; + for (const QByteArray &e : qAsConst(exts)) + all += ' ' + e; qCDebug(QSG_LOG_INFO) << "GL_EXTENSIONS: " << all.constData(); qCDebug(QSG_LOG_INFO) << "Max Texture Size: " << openglRenderContext->maxTextureSize(); qCDebug(QSG_LOG_INFO) << "Debug context: " << format.testOption(QSurfaceFormat::DebugContext); diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 1a9b576af4..e99e8dfe2e 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -100,7 +100,7 @@ void QSGRenderLoop::cleanup() { if (!s_instance) return; - foreach (QQuickWindow *w, s_instance->windows()) { + for (QQuickWindow *w : s_instance->windows()) { QQuickWindowPrivate *wd = QQuickWindowPrivate::get(w); if (wd->windowManager == s_instance) { s_instance->windowDestroyed(w); diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 371f512c6e..743e524a36 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -263,7 +263,7 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window) bool QSGWindowsRenderLoop::anyoneShowing() const { - foreach (const WindowData &wd, m_windows) + for (const WindowData &wd : qAsConst(m_windows)) if (wd.window->isVisible() && wd.window->isExposed() && wd.window->size().isValid()) return true; return false; @@ -382,7 +382,7 @@ void QSGWindowsRenderLoop::render() { RLDEBUG("render"); bool rendered = false; - foreach (const WindowData &wd, m_windows) { + for (const WindowData &wd : qAsConst(m_windows)) { if (wd.pendingUpdate) { const_cast<WindowData &>(wd).pendingUpdate = false; renderWindow(wd.window); |