diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-12-04 17:27:16 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-28 19:37:39 +0000 |
commit | 64b2eb7490f502feececec314eb215bbb7832858 (patch) | |
tree | 74cde25d3c12dbdc61647e2de986ba5ab8a36707 /examples/widgets/widgets/validators/localeselector.cpp | |
parent | f9e6f8efda350689211286db9154677924df8aab (diff) |
Cleanup Widgets examples - replace foreach
Cleanup the Widget examples - replace foreach with a standard for loop
Change-Id: I59cb2bf4494201f9f0228b07a8bb936ce40da46f
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/widgets/widgets/validators/localeselector.cpp')
-rw-r--r-- | examples/widgets/widgets/validators/localeselector.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/widgets/widgets/validators/localeselector.cpp b/examples/widgets/widgets/validators/localeselector.cpp index 7253fea9ec..1382da0cc9 100644 --- a/examples/widgets/widgets/validators/localeselector.cpp +++ b/examples/widgets/widgets/validators/localeselector.cpp @@ -59,7 +59,9 @@ LocaleSelector::LocaleSelector(QWidget *parent) int index = 0; for (int _lang = QLocale::C; _lang <= QLocale::LastLanguage; ++_lang) { QLocale::Language lang = static_cast<QLocale::Language>(_lang); - foreach (const QLocale &l, QLocale::matchingLocales(lang, QLocale::AnyScript, QLocale::AnyCountry)) { + const QList<QLocale> locales = + QLocale::matchingLocales(lang, QLocale::AnyScript, QLocale::AnyCountry); + for (const QLocale &l : locales) { QString label = QLocale::languageToString(l.language()); label += QLatin1Char('/'); label += QLocale::countryToString(l.country()); |