aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/creationtime/tst_creationtime.cpp
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-23 11:33:30 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-09-02 18:26:59 +0000
commit73baf55b107350211e53bdf839a6ba2d273865bd (patch)
tree651e9dc758d79065219c40fb48063be77a012ca2 /tests/benchmarks/creationtime/tst_creationtime.cpp
parent33904b63ce9971efc3763a0048a084ec3324dfc4 (diff)
Replace 'foreach' with 'range for'
And add QT_NO_FOREACH define to .qmake.conf. Now QuickControls2 is 'foreach' free. Change-Id: I98695258859decadae6fd2f23f5f6f5ef2b0550f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/benchmarks/creationtime/tst_creationtime.cpp')
-rw-r--r--tests/benchmarks/creationtime/tst_creationtime.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/benchmarks/creationtime/tst_creationtime.cpp b/tests/benchmarks/creationtime/tst_creationtime.cpp
index 877cf273..3eec3825 100644
--- a/tests/benchmarks/creationtime/tst_creationtime.cpp
+++ b/tests/benchmarks/creationtime/tst_creationtime.cpp
@@ -78,11 +78,12 @@ static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QSt
// the engine's import path. This way we can use QQmlComponent to load each QML file
// for benchmarking.
- QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + sourcePath).entryInfoList(QStringList("*.qml"), QDir::Files);
- foreach (const QFileInfo &entry, entries) {
+ const QFileInfoList entries = QDir(QQC2_IMPORT_PATH "/" + sourcePath).entryInfoList(QStringList("*.qml"), QDir::Files);
+ for (const QFileInfo &entry : entries) {
QString name = entry.baseName();
if (!skiplist.contains(name)) {
- foreach (const QString &importPath, engine->importPathList()) {
+ const auto importPathList = engine->importPathList();
+ for (const QString &importPath : importPathList) {
QString name = entry.dir().dirName() + "/" + entry.fileName();
QString filePath = importPath + "/" + targetPath + "/" + entry.fileName();
if (QFile::exists(filePath)) {