diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp index 85ed345869..4bb52a8d8a 100644 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp @@ -983,9 +983,9 @@ QList QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country coun { // TODO AnyCountry QList result; - foreach (const QByteArray &key, tzZones->keys()) { - if (tzZones->value(key).country == country) - result << key; + for (auto it = tzZones->cbegin(), end = tzZones->cend(); it != end; ++it) { + if (it.value().country == country) + result << it.key(); } std::sort(result.begin(), result.end()); return result;