diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
commit | 6630937e63ae5797487b86743a7733c8ae5cc42c (patch) | |
tree | 3d53dacf6430f9099e1fb20835881205de674961 /examples/widgets/widgets/validators/localeselector.cpp | |
parent | 37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff) | |
parent | c7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff) |
Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
Diffstat (limited to 'examples/widgets/widgets/validators/localeselector.cpp')
-rw-r--r-- | examples/widgets/widgets/validators/localeselector.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/widgets/widgets/validators/localeselector.cpp b/examples/widgets/widgets/validators/localeselector.cpp index 2f702c9753..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()); @@ -79,7 +81,8 @@ LocaleSelector::LocaleSelector(QWidget *parent) if (curIndex != -1) setCurrentIndex(curIndex); - connect(this, SIGNAL(activated(int)), this, SLOT(emitLocaleSelected(int))); + connect(this, QOverload<int>::of(&LocaleSelector::activated), + this, &LocaleSelector::emitLocaleSelected); } void LocaleSelector::emitLocaleSelected(int index) |