Fix compiler warning

tst_qqmlproperty.cpp:2426:55: warning: loop variable 'flagSet' of type
'const QQmlPropertyPrivate::InitFlags' (aka 'const QFlags<QQmlPropertyPrivate::InitFlag>')
creates a copy from type 'const QQmlPropertyPrivate::InitFlags' [-Wrange-loop-analysis]

Use idomatic "const auto &" in ranged for loop.

Change-Id: I9efcf5dad6204ddd6ddbc117f87d3b1f7c943fc1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-11-08 09:47:03 +01:00
parent 32bd6ba7e9
commit 30728c1107
1 changed files with 1 additions and 1 deletions

View File

@ -2423,7 +2423,7 @@ void tst_qqmlproperty::initFlags_data()
for (int i = 0; i < 2; ++i) {
const bool passObject = (i != 0);
for (const QString &name : names) {
for (const QQmlPropertyPrivate::InitFlags flagSet : flagSets) {
for (const auto &flagSet : flagSets) {
const QString rowName = QStringLiteral("%1,%2,%3")
.arg(passObject).arg(name).arg(flagSet.toInt());
QTest::addRow("%s", qPrintable(rowName)) << passObject << name << flagSet;