diff options
author | JiDe Zhang <zhangjide@uniontech.com> | 2021-03-09 16:19:54 +0800 |
---|---|---|
committer | JiDe Zhang <zhangjide@uniontech.com> | 2021-04-15 20:17:49 +0800 |
commit | 50a7eb8cf75a2f9cebde6d0d23c108e5e7f1870b (patch) | |
tree | c947e4746bb55f723c4005534cb98501f083036a /tests/manual/qlocale/info.cpp | |
parent | 7c8d45cb2635ab44d85d85288fd74ef72909264c (diff) |
Add the "Territory" enumerated type for QLocale
The use of "Country" is misleading as some entries in the enumeration
are not countries (eg, HongKong), for all that most are. The Unicode
Consortium's Common Locale Data Repository (CLDR, from which QLocale's
data is taken) calls these territories, so introduce territory-based
names and prepare to deprecate the country-based ones in due course.
[ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for
its Country enumeration, and associated territory-based names to match
its country-named methods, to better match the usage in relevant
standards. The country-based names shall in due course be deprecated
in favor of the territory-based names.
Fixes: QTBUG-91686
Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/manual/qlocale/info.cpp')
-rw-r--r-- | tests/manual/qlocale/info.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/manual/qlocale/info.cpp b/tests/manual/qlocale/info.cpp index 4d082577d4..3f23403350 100644 --- a/tests/manual/qlocale/info.cpp +++ b/tests/manual/qlocale/info.cpp @@ -53,8 +53,8 @@ InfoWidget::InfoWidget() languageName = addItem("Language name:"); nativeLanguageName = addItem("Native language name:"); scriptName = addItem("Script name:"); - countryName = addItem("Country name:"); - nativeCountryName = addItem("Native country name:"); + territoryName = addItem("Territory name:"); + nativeTerritoryName = addItem("Native territory name:"); } void InfoWidget::localeChanged(QLocale locale) @@ -65,8 +65,8 @@ void InfoWidget::localeChanged(QLocale locale) languageName->setText(QLocale::languageToString(locale.language())); nativeLanguageName->setText(locale.nativeLanguageName()); scriptName->setText(QLocale::scriptToString(locale.script())); - countryName->setText(QLocale::countryToString(locale.country())); - nativeCountryName->setText(locale.nativeCountryName()); + territoryName->setText(QLocale::territoryToString(locale.territory())); + nativeTerritoryName->setText(locale.nativeTerritoryName()); } void InfoWidget::addItem(const QString &label, QWidget *w) |