📄 qlocale.cpp
字号:
\value Andorra \value Angola \value Anguilla \value Antarctica \value AntiguaAndBarbuda \value Argentina \value Armenia \value Aruba \value Australia \value Austria \value Azerbaijan \value Bahamas \value Bahrain \value Bangladesh \value Barbados \value Belarus \value Belgium \value Belize \value Benin \value Bermuda \value Bhutan \value Bolivia \value BosniaAndHerzegowina \value Botswana \value BouvetIsland \value Brazil \value BritishIndianOceanTerritory \value BruneiDarussalam \value Bulgaria \value BurkinaFaso \value Burundi \value Cambodia \value Cameroon \value Canada \value CapeVerde \value CaymanIslands \value CentralAfricanRepublic \value Chad \value Chile \value China \value ChristmasIsland \value CocosIslands \value Colombia \value Comoros \value DemocraticRepublicOfCongo \value PeoplesRepublicOfCongo \value CookIslands \value CostaRica \value IvoryCoast \value Croatia \value Cuba \value Cyprus \value CzechRepublic \value Denmark \value Djibouti \value Dominica \value DominicanRepublic \value EastTimor \value Ecuador \value Egypt \value ElSalvador \value EquatorialGuinea \value Eritrea \value Estonia \value Ethiopia \value FalklandIslands \value FaroeIslands \value FijiCountry \value Finland \value France \value MetropolitanFrance \value FrenchGuiana \value FrenchPolynesia \value FrenchSouthernTerritories \value Gabon \value Gambia \value Georgia \value Germany \value Ghana \value Gibraltar \value Greece \value Greenland \value Grenada \value Guadeloupe \value Guam \value Guatemala \value Guinea \value GuineaBissau \value Guyana \value Haiti \value HeardAndMcDonaldIslands \value Honduras \value HongKong \value Hungary \value Iceland \value India \value Indonesia \value Iran \value Iraq \value Ireland \value Israel \value Italy \value Jamaica \value Japan \value Jordan \value Kazakhstan \value Kenya \value Kiribati \value DemocraticRepublicOfKorea \value RepublicOfKorea \value Kuwait \value Kyrgyzstan \value Lao \value Latvia \value Lebanon \value Lesotho \value Liberia \value LibyanArabJamahiriya \value Liechtenstein \value Lithuania \value Luxembourg \value Macau \value Macedonia \value Madagascar \value Malawi \value Malaysia \value Maldives \value Mali \value Malta \value MarshallIslands \value Martinique \value Mauritania \value Mauritius \value Mayotte \value Mexico \value Micronesia \value Moldova \value Monaco \value Mongolia \value Montserrat \value Morocco \value Mozambique \value Myanmar \value Namibia \value NauruCountry \value Nepal \value Netherlands \value NetherlandsAntilles \value NewCaledonia \value NewZealand \value Nicaragua \value Niger \value Nigeria \value Niue \value NorfolkIsland \value NorthernMarianaIslands \value Norway \value Oman \value Pakistan \value Palau \value PalestinianTerritory \value Panama \value PapuaNewGuinea \value Paraguay \value Peru \value Philippines \value Pitcairn \value Poland \value Portugal \value PuertoRico \value Qatar \value Reunion \value Romania \value RussianFederation \value Rwanda \value SaintKittsAndNevis \value StLucia \value StVincentAndTheGrenadines \value Samoa \value SanMarino \value SaoTomeAndPrincipe \value SaudiArabia \value Senegal \value SerbiaAndMontenegro \value Seychelles \value SierraLeone \value Singapore \value Slovakia \value Slovenia \value SolomonIslands \value Somalia \value SouthAfrica \value SouthGeorgiaAndTheSouthSandwichIslands \value Spain \value SriLanka \value StHelena \value StPierreAndMiquelon \value Sudan \value Suriname \value SvalbardAndJanMayenIslands \value Swaziland \value Sweden \value Switzerland \value SyrianArabRepublic \value Taiwan \value Tajikistan \value Tanzania \value Thailand \value Togo \value Tokelau \value TongaCountry \value TrinidadAndTobago \value Tunisia \value Turkey \value Turkmenistan \value TurksAndCaicosIslands \value Tuvalu \value Uganda \value Ukraine \value UnitedArabEmirates \value UnitedKingdom \value UnitedStates \value UnitedStatesMinorOutlyingIslands \value Uruguay \value Uzbekistan \value Vanuatu \value VaticanCityState \value Venezuela \value VietNam \value BritishVirginIslands \value USVirginIslands \value WallisAndFutunaIslands \value WesternSahara \value Yemen \value Yugoslavia \value Zambia \value Zimbabwe \omitvalue LastCountry \sa country()*//*! \enum QLocale::FormatType This enum describes the types of format that can be used when converting QDate and QTime objects to strings. \value LongFormat \value ShortFormat*//*! \fn bool QLocale::operator==(const QLocale &other) const Returns true if the QLocale object is the same as the \a other locale specified; otherwise returns false.*//*! \fn bool QLocale::operator!=(const QLocale &other) const Returns true if the QLocale object is not the same as the \a other locale specified; otherwise returns false.*//*! Constructs a QLocale object with the specified \a name, which has the format "language[_country][.codeset][@modifier]" or "C", where: \list \i language is a lowercase, two-letter, ISO 639 language code, \i territory is an uppercase, two-letter, ISO 3166 country code, \i and codeset and modifier are ignored. \endlist If the string violates the locale format, or language is not a valid ISO 369 code, the "C" locale is used instead. If country is not present, or is not a valid ISO 3166 code, the most appropriate country is chosen for the specified language. The language and country codes are converted to their respective \c Language and \c Country enums. After this conversion is performed the constructor behaves exactly like QLocale(Country, Language). This constructor is much slower than QLocale(Country, Language). \sa name()*/QLocale::QLocale(const QString &name){ d = findLocale(name);}/*! Constructs a QLocale object initialized with the default locale. If no default locale was set using setDefaultLocale(), this locale will be the same as the one returned by system(). \sa setDefault()*/QLocale::QLocale(){ if (default_d == 0) default_d = system().d; d = default_d;}/*! Constructs a QLocale object with the specified \a language and \a country. \list \i If the language/country pair is found in the database, it is used. \i If the language is found but the country is not, or if the country is \c AnyCountry, the language is used with the most appropriate available country (for example, Germany for German), \i If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault()). \endlist The language and country that are actually used can be queried using language() and country(). \sa setDefault() language() country()*/QLocale::QLocale(Language language, Country country){ d = findLocale(language, country); // If not found, should default to system if (d->languageId() == QLocale::C && language != QLocale::C) { if (default_d == 0) default_d = system().d; d = default_d; }}/*! Constructs a QLocale object as a copy of \a other.*/QLocale::QLocale(const QLocale &other){ d = other.d;}/*! Assigns \a other to this QLocale object and returns a reference to this QLocale object.*/QLocale &QLocale::operator=(const QLocale &other){ d = other.d; return *this;}/*! \nonreentrant Sets the global default locale to \a locale. These values are used when a QLocale object is constructed with no arguments. If this function is not called, the system's locale is used. \warning In a multithreaded application, the default locale should be set at application startup, before any non-GUI threads are created. \sa system() c()*/void QLocale::setDefault(const QLocale &locale){ default_d = locale.d;}/*! Returns the language of this locale. \sa country(), languageToString(), name()*/QLocale::Language QLocale::language() const{ return Language(d->languageId());}/*! Returns the country of this locale. \sa language(), countryToString(), name()*/QLocale::Country QLocale::country() const{ return Country(d->countryId());}/*! Returns the language and country of this locale as a string of the form "language_country", where language is a lowercase, two-letter ISO 639 language code, and country is an uppercase, two-letter ISO 3166 country code. \sa language(), country()*/QString QLocale::name() const{ Language l = language(); QString result = languageToCode(l); if (l == C) return result; Country c = country(); if (c == AnyCountry) return result; result.append(QLatin1Char('_')); result.append(countryToCode(c)); return result;}/*! Returns a QString containing the name of \a language. \sa countryToString(), name()*/QString QLocale::languageToString(Language language){ if (uint(language) > uint(QLocale::LastLanguage)) return QLatin1String("Unknown"); return QLatin1String(language_name_list + language_name_index[language]);}/*! Returns a QString containing the name of \a country. \sa country(), name()*/QString QLocale::countryToString(Country country){ if (uint(country) > uint(QLocale::LastCountry)) return QLatin1String("Unknown"); return QLatin1String(country_name_list + country_name_index[country]);}/*! Returns the short int represented by the localized string \a s, using base \a base. If \a base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal. If the conversion fails the function returns 0. If \a ok is not 0, failure is reported by setting *ok to false, and
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -