summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-01-04 15:03:27 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-01-04 14:29:09 +0000
commitb84927dc2b91429e2aa1bdd290a8b16b9d24ca58 (patch)
tree4e5a4106afd02a020717118d8962d907e2b2c80f /tools
parent34dff74b75b818072882594e518faed9498b1f4d (diff)
qmlcachegen: Eliminate foreach
Change-Id: Ic13e5af7ddb92cf5988988ebe1c2b7470a5f8c1e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlcachegen/generateloader.cpp2
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp
index 0027d53d00..5b8fc34455 100644
--- a/tools/qmlcachegen/generateloader.cpp
+++ b/tools/qmlcachegen/generateloader.cpp
@@ -273,7 +273,7 @@ static QByteArray generateResourceDirectoryTree(QTextStream &code, const QString
VirtualDirectoryEntry resourceDirs;
resourceDirs.name = QStringLiteral("/");
- foreach (const QString &entry, qrcFiles) {
+ for (const QString &entry : qrcFiles) {
const QStringList segments = entry.split(QLatin1Char('/'), QString::SkipEmptyParts);
VirtualDirectoryEntry *dirEntry = &resourceDirs;
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index b3c55e85e0..f7891e7d4b 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -117,7 +117,7 @@ static void annotateListElements(QmlIR::Document *document)
{
QStringList listElementNames;
- foreach (const QV4::CompiledData::Import *import, document->imports) {
+ for (const QV4::CompiledData::Import *import : qAsConst(document->imports)) {
const QString uri = document->stringAt(import->uriIndex);
if (uri != QStringLiteral("QtQml.Models") && uri != QStringLiteral("QtQuick"))
continue;
@@ -134,7 +134,7 @@ static void annotateListElements(QmlIR::Document *document)
if (listElementNames.isEmpty())
return;
- foreach (QmlIR::Object *object, document->objects) {
+ for (QmlIR::Object *object : qAsConst(document->objects)) {
if (!listElementNames.contains(document->stringAt(object->inheritedTypeNameIndex)))
continue;
for (QmlIR::Binding *binding = object->firstBinding(); binding; binding = binding->next) {