diff options
Diffstat (limited to 'tests/manual/qlocale/window.cpp')
-rw-r--r-- | tests/manual/qlocale/window.cpp | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/tests/manual/qlocale/window.cpp b/tests/manual/qlocale/window.cpp index 059192492c..48fdec5f4d 100644 --- a/tests/manual/qlocale/window.cpp +++ b/tests/manual/qlocale/window.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "window.h" @@ -41,15 +16,15 @@ Window::Window() localeCombo->addItem("System", QLocale::system()); - QList<QLocale> locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry); - foreach (const QLocale &locale, locales) { + const QList<QLocale> locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyTerritory); + for (const QLocale &locale : locales) { QString label = QLocale::languageToString(locale.language()); label += QLatin1Char('/'); if (locale.script() != QLocale::AnyScript) { label += QLocale::scriptToString(locale.script()); label += QLatin1Char('/'); } - label += QLocale::countryToString(locale.country()); + label += QLocale::territoryToString(locale.territory()); localeCombo->addItem(label, locale); } @@ -103,11 +78,11 @@ void Window::systemLocaleChanged() QLocale l = QLocale::system(); QString lang = QLocale::languageToString(l.language()); QString script = QLocale::scriptToString(l.script()); - QString country = QLocale::countryToString(l.country()); + QString territory = QLocale::territoryToString(l.territory()); if (l.script() != QLocale::AnyScript) - localeCombo->setItemText(0, QString("System: %1-%2-%3").arg(lang, script, country)); + localeCombo->setItemText(0, QString("System: %1-%2-%3").arg(lang, script, territory)); else - localeCombo->setItemText(0, QString("System: %1-%2").arg(lang, country)); + localeCombo->setItemText(0, QString("System: %1-%2").arg(lang, territory)); emit localeChanged(0); } |