Obsolete Members for QLocale

以下成员源于类 QLocale 被弃用。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

(deprecated (6.6)) QLocale::Country country () const
(deprecated (6.6)) QString nativeCountryName () const

静态公共成员

(deprecated (6.6)) QLocale::Country codeToCountry (QStringView countryCode )
(deprecated (6.6)) QList<QLocale::Country> countriesForLanguage (QLocale::Language 语言 )
(deprecated (6.6)) QString countryToCode (QLocale::Country country )
(deprecated (6.6)) QString countryToString (QLocale::Country country )

成员函数文档编制

[static, since 6.1] QLocale::Country QLocale:: codeToCountry ( QStringView countryCode )

This function is deprecated since 6.6. We strongly advise against using it in new code.

Returns the QLocale::Territory enum corresponding to the two-letter or three-digit countryCode ,如 ISO 3166 标准定义的。

若代码无效或未知 QLocale::AnyTerritory 被返回。

使用 codeToTerritory ( QStringView ) 代替。

该函数在 Qt 6.1 引入。

另请参阅 territoryToCode (), codeToLanguage (),和 codeToScript ().

[static] QList < QLocale::Country > QLocale:: countriesForLanguage ( QLocale::Language 语言 )

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 matchingLocales () instead and consult the territory () of each.

Returns the list of countries that have entries for 语言 in Qt's locale database. If the result is an empty list, then 语言 is not represented in Qt's locale database.

另请参阅 matchingLocales ().

QLocale::Country QLocale:: country () const

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 territory () 代替。

返回此区域设置的地区。

另请参阅 language (), script (), territoryToString (),和 bcp47Name ().

[static] QString QLocale:: countryToCode ( QLocale::Country country )

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 territoryToCode () 代替。

返回 2 字母地区代码为 country ,如 ISO 3166 标准定义的。

注意: For QLocale::AnyTerritory or QLocale::AnyCountry 返回空字符串。

另请参阅 codeToTerritory (), territory (), name (), bcp47Name (), languageToCode (),和 scriptToCode ().

[static] QString QLocale:: countryToString ( QLocale::Country country )

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 territoryToString () 代替。

返回 QString 包含名称对于 country .

另请参阅 languageToString (), scriptToString (), territory (),和 bcp47Name ().

QString QLocale:: nativeCountryName () const

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 nativeTerritoryName () 代替。

Returns a native name of the territory for the locale. For example "España" for Spanish/Spain locale.

另请参阅 nativeLanguageName () 和 territoryToString ().