From bcd7d223f066f2830501c2be79f1e7e4f6dd8f50 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 26 Jan 2016 14:38:54 +0100 Subject: QtGui: eradicate Q_FOREACH loops [rvalues] ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I457942159015ff153bdfc6d5f031a3f0a0f6e9ac Reviewed-by: Gunnar Sletta Reviewed-by: Lars Knoll --- src/gui/opengl/qopengldebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/opengl') diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp index 0132dc03bb..5f0164c3e1 100644 --- a/src/gui/opengl/qopengldebug.cpp +++ b/src/gui/opengl/qopengldebug.cpp @@ -176,8 +176,8 @@ QT_BEGIN_NAMESPACE \code - QList messages = logger->loggedMessages(); - foreach (const QOpenGLDebugMessage &message, messages) + const QList messages = logger->loggedMessages(); + for (const QOpenGLDebugMessage &message : messages) qDebug() << message; \endcode -- cgit v1.2.3