aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-01-16 10:36:45 +0100
committerRobin Burchell <robin.burchell@crimson.no>2017-01-16 10:02:56 +0000
commitd8ce18b323f0eb8850177f86065f520bb555b5a4 (patch)
tree253610535cc891be8b637022556fe777065e44b7 /src
parented024294c570b948970b36bc8ad8b303bfeebe4a (diff)
Quick: Remove last foreach, and mark QT_NO_FOREACH
Longer term, we should QT_NO_FOREACH .qmake.conf, but a number of other parts of the codebase still use foreach. Change-Id: I105cdbe2a64ae40ffa53d3aaa8765b09195af841 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickitem.cpp2
-rw-r--r--src/quick/quick.pro2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 01737548c8..f7b9a58329 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -8389,7 +8389,7 @@ void QQuickItemWrapper::markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine
{
QObjectWrapper::Data *This = static_cast<QObjectWrapper::Data *>(that);
if (QQuickItem *item = static_cast<QQuickItem*>(This->object())) {
- foreach (QQuickItem *child, QQuickItemPrivate::get(item)->childItems)
+ for (QQuickItem *child : qAsConst(QQuickItemPrivate::get(item)->childItems))
QV4::QObjectWrapper::markWrapper(child, e);
}
QV4::QObjectWrapper::markObjects(that, e);
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index 8f4f9a8290..eae9b09b2f 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -9,6 +9,8 @@ win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS
solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
win32:!winrt: LIBS += -luser32
+DEFINES += QT_NO_FOREACH
+
exists("qqml_enable_gcov") {
QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors
LIBS_PRIVATE += -lgcov