⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qlocale.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 3 页
字号:
'\" t.TH QLocale 3qt "21 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQLocale \- Converts between numbers and their string representations in various languages.SH SYNOPSISAlmost all the functions in this class are reentrant when Qt is built with thread support. The exception is \fBsetDefault\fR(). </p>.PP\fC#include <qlocale.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBLanguage\fR { C = 1, Abkhazian = 2, Afan = 3, Afar = 4, Afrikaans = 5, Albanian = 6, Amharic = 7, Arabic = 8, Armenian = 9, Assamese = 10, Aymara = 11, Azerbaijani = 12, Bashkir = 13, Basque = 14, Bengali = 15, Bhutani = 16, Bihari = 17, Bislama = 18, Breton = 19, Bulgarian = 20, Burmese = 21, Byelorussian = 22, Cambodian = 23, Catalan = 24, Chinese = 25, Corsican = 26, Croatian = 27, Czech = 28, Danish = 29, Dutch = 30, English = 31, Esperanto = 32, Estonian = 33, Faroese = 34, FijiLanguage = 35, Finnish = 36, French = 37, Frisian = 38, Gaelic = 39, Galician = 40, Georgian = 41, German = 42, Greek = 43, Greenlandic = 44, Guarani = 45, Gujarati = 46, Hausa = 47, Hebrew = 48, Hindi = 49, Hungarian = 50, Icelandic = 51, Indonesian = 52, Interlingua = 53, Interlingue = 54, Inuktitut = 55, Inupiak = 56, Irish = 57, Italian = 58, Japanese = 59, Javanese = 60, Kannada = 61, Kashmiri = 62, Kazakh = 63, Kinyarwanda = 64, Kirghiz = 65, Korean = 66, Kurdish = 67, Kurundi = 68, Laothian = 69, Latin = 70, Latvian = 71, Lingala = 72, Lithuanian = 73, Macedonian = 74, Malagasy = 75, Malay = 76, Malayalam = 77, Maltese = 78, Maori = 79, Marathi = 80, Moldavian = 81, Mongolian = 82, NauruLanguage = 83, Nepali = 84, Norwegian = 85, Occitan = 86, Oriya = 87, Pashto = 88, Persian = 89, Polish = 90, Portuguese = 91, Punjabi = 92, Quechua = 93, RhaetoRomance = 94, Romanian = 95, Russian = 96, Samoan = 97, Sangho = 98, Sanskrit = 99, Serbian = 100, SerboCroatian = 101, Sesotho = 102, Setswana = 103, Shona = 104, Sindhi = 105, Singhalese = 106, Siswati = 107, Slovak = 108, Slovenian = 109, Somali = 110, Spanish = 111, Sundanese = 112, Swahili = 113, Swedish = 114, Tagalog = 115, Tajik = 116, Tamil = 117, Tatar = 118, Telugu = 119, Thai = 120, Tibetan = 121, Tigrinya = 122, TongaLanguage = 123, Tsonga = 124, Turkish = 125, Turkmen = 126, Twi = 127, Uigur = 128, Ukrainian = 129, Urdu = 130, Uzbek = 131, Vietnamese = 132, Volapuk = 133, Welsh = 134, Wolof = 135, Xhosa = 136, Yiddish = 137, Yoruba = 138, Zhuang = 139, Zulu = 140, LastLanguage = Zulu }".br.ti -1c.BI "enum \fBCountry\fR { AnyCountry = 0, Afghanistan = 1, Albania = 2, Algeria = 3, AmericanSamoa = 4, Andorra = 5, Angola = 6, Anguilla = 7, Antarctica = 8, AntiguaAndBarbuda = 9, Argentina = 10, Armenia = 11, Aruba = 12, Australia = 13, Austria = 14, Azerbaijan = 15, Bahamas = 16, Bahrain = 17, Bangladesh = 18, Barbados = 19, Belarus = 20, Belgium = 21, Belize = 22, Benin = 23, Bermuda = 24, Bhutan = 25, Bolivia = 26, BosniaAndHerzegowina = 27, Botswana = 28, BouvetIsland = 29, Brazil = 30, BritishIndianOceanTerritory = 31, BruneiDarussalam = 32, Bulgaria = 33, BurkinaFaso = 34, Burundi = 35, Cambodia = 36, Cameroon = 37, Canada = 38, CapeVerde = 39, CaymanIslands = 40, CentralAfricanRepublic = 41, Chad = 42, Chile = 43, China = 44, ChristmasIsland = 45, CocosIslands = 46, Colombia = 47, Comoros = 48, DemocraticRepublicOfCongo = 49, PeoplesRepublicOfCongo = 50, CookIslands = 51, CostaRica = 52, IvoryCoast = 53, Croatia = 54, Cuba = 55, Cyprus = 56, CzechRepublic = 57, Denmark = 58, Djibouti = 59, Dominica = 60, DominicanRepublic = 61, EastTimor = 62, Ecuador = 63, Egypt = 64, ElSalvador = 65, EquatorialGuinea = 66, Eritrea = 67, Estonia = 68, Ethiopia = 69, FalklandIslands = 70, FaroeIslands = 71, FijiCountry = 72, Finland = 73, France = 74, MetropolitanFrance = 75, FrenchGuiana = 76, FrenchPolynesia = 77, FrenchSouthernTerritories = 78, Gabon = 79, Gambia = 80, Georgia = 81, Germany = 82, Ghana = 83, Gibraltar = 84, Greece = 85, Greenland = 86, Grenada = 87, Guadeloupe = 88, Guam = 89, Guatemala = 90, Guinea = 91, GuineaBissau = 92, Guyana = 93, Haiti = 94, HeardAndMcDonaldIslands = 95, Honduras = 96, HongKong = 97, Hungary = 98, Iceland = 99, India = 100, Indonesia = 101, Iran = 102, Iraq = 103, Ireland = 104, Israel = 105, Italy = 106, Jamaica = 107, Japan = 108, Jordan = 109, Kazakhstan = 110, Kenya = 111, Kiribati = 112, DemocraticRepublicOfKorea = 113, RepublicOfKorea = 114, Kuwait = 115, Kyrgyzstan = 116, Lao = 117, Latvia = 118, Lebanon = 119, Lesotho = 120, Liberia = 121, LibyanArabJamahiriya = 122, Liechtenstein = 123, Lithuania = 124, Luxembourg = 125, Macau = 126, Macedonia = 127, Madagascar = 128, Malawi = 129, Malaysia = 130, Maldives = 131, Mali = 132, Malta = 133, MarshallIslands = 134, Martinique = 135, Mauritania = 136, Mauritius = 137, Mayotte = 138, Mexico = 139, Micronesia = 140, Moldova = 141, Monaco = 142, Mongolia = 143, Montserrat = 144, Morocco = 145, Mozambique = 146, Myanmar = 147, Namibia = 148, NauruCountry = 149, Nepal = 150, Netherlands = 151, NetherlandsAntilles = 152, NewCaledonia = 153, NewZealand = 154, Nicaragua = 155, Niger = 156, Nigeria = 157, Niue = 158, NorfolkIsland = 159, NorthernMarianaIslands = 160, Norway = 161, Oman = 162, Pakistan = 163, Palau = 164, PalestinianTerritory = 165, Panama = 166, PapuaNewGuinea = 167, Paraguay = 168, Peru = 169, Philippines = 170, Pitcairn = 171, Poland = 172, Portugal = 173, PuertoRico = 174, Qatar = 175, Reunion = 176, Romania = 177, RussianFederation = 178, Rwanda = 179, SaintKittsAndNevis = 180, StLucia = 181, StVincentAndTheGrenadines = 182, Samoa = 183, SanMarino = 184, SaoTomeAndPrincipe = 185, SaudiArabia = 186, Senegal = 187, Seychelles = 188, SierraLeone = 189, Singapore = 190, Slovakia = 191, Slovenia = 192, SolomonIslands = 193, Somalia = 194, SouthAfrica = 195, SouthGeorgiaAndTheSouthSandwichIslands = 196, Spain = 197, SriLanka = 198, StHelena = 199, StPierreAndMiquelon = 200, Sudan = 201, Suriname = 202, SvalbardAndJanMayenIslands = 203, Swaziland = 204, Sweden = 205, Switzerland = 206, SyrianArabRepublic = 207, Taiwan = 208, Tajikistan = 209, Tanzania = 210, Thailand = 211, Togo = 212, Tokelau = 213, TongaCountry = 214, TrinidadAndTobago = 215, Tunisia = 216, Turkey = 217, Turkmenistan = 218, TurksAndCaicosIslands = 219, Tuvalu = 220, Uganda = 221, Ukraine = 222, UnitedArabEmirates = 223, UnitedKingdom = 224, UnitedStates = 225, UnitedStatesMinorOutlyingIslands = 226, Uruguay = 227, Uzbekistan = 228, Vanuatu = 229, VaticanCityState = 230, Venezuela = 231, VietNam = 232, BritishVirginIslands = 233, USVirginIslands = 234, WallisAndFutunaIslands = 235, WesternSahara = 236, Yemen = 237, Yugoslavia = 238, Zambia = 239, Zimbabwe = 240, LastCountry = Zimbabwe }".br.ti -1c.BI "\fBQLocale\fR ()".br.ti -1c.BI "\fBQLocale\fR ( const QString & name )".br.ti -1c.BI "\fBQLocale\fR ( Language language, Country country = AnyCountry )".br.ti -1c.BI "\fBQLocale\fR ( const QLocale & other )".br.ti -1c.BI "QLocale & \fBoperator=\fR ( const QLocale & other )".br.ti -1c.BI "Language \fBlanguage\fR () const".br.ti -1c.BI "Country \fBcountry\fR () const".br.ti -1c.BI "QString \fBname\fR () const".br.ti -1c.BI "short \fBtoShort\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "ushort \fBtoUShort\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "int \fBtoInt\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "uint \fBtoUInt\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "Q_LONG \fBtoLong\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "Q_ULONG \fBtoULong\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "Q_LLONG \fBtoLongLong\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "Q_ULLONG \fBtoULongLong\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "float \fBtoFloat\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "double \fBtoDouble\fR ( const QString & s, bool * ok = 0 ) const".br.ti -1c.BI "QString \fBtoString\fR ( short i ) const".br.ti -1c.BI "QString \fBtoString\fR ( ushort i ) const".br.ti -1c.BI "QString \fBtoString\fR ( int i ) const".br.ti -1c.BI "QString \fBtoString\fR ( uint i ) const".br.ti -1c.BI "QString \fBtoString\fR ( Q_LONG i ) const".br.ti -1c.BI "QString \fBtoString\fR ( Q_ULONG i ) const".br.ti -1c.BI "QString \fBtoString\fR ( Q_LLONG i ) const".br.ti -1c.BI "QString \fBtoString\fR ( Q_ULLONG i ) const".br.ti -1c.BI "QString \fBtoString\fR ( float i, char f = 'g', int prec = 6 ) const".br.ti -1c.BI "QString \fBtoString\fR ( double i, char f = 'g', int prec = 6 ) const".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QString \fBlanguageToString\fR ( Language language )".br.ti -1c.BI "QString \fBcountryToString\fR ( Country country )".br.ti -1c.BI "void \fBsetDefault\fR ( const QLocale & locale )".br.ti -1c.BI "QLocale \fBc\fR ()".br.ti -1c.BI "QLocale \fBsystem\fR ()".br.in -1c.SH DESCRIPTIONThe QLocale class converts between numbers and their string representations in various languages..PPIt is initialized with a country/language pair in its constructor and offers number-to-string and string-to-number conversion functions simmilar to those in QString..PP.nf.br    QLocale egyptian(QLocale::Arabic, QLocale::Egypt);.br    QString s1 = egyptian.toString(1.571429E+07, 'e');.br    QString s2 = egyptian.toString(10);.br.br    double d = egyptian.toDouble(s1);.br    int s2 = egyptian.toInt(s2);.br.fi.PPQLocale supports the concept of a default locale, which is determined from the system's locale settings at application startup. The default locale can be changed by calling the static member setDefault(). The default locale has the following effects:.TPIf a QLocale object is constructed with the default constructor, it will use the default locale's settings..TPQString::toDouble() interprets the string according to the default locale. If this fails, it falls back on the "C" locale..TPQString::arg() uses the default locale to format a number when its position specifier in the format string contains an 'L', e.g. "%L1"..PP.nf.br    QLocale::setDefault(QLocale(QLocale::Hebrew, QLocale::Israel));.br    QLocale hebrew; // Constructs a default QLocale.br    QString s1 = hebrew.toString(15714.3, 'e');.br.br    bool ok;.br    double d;.br.br    QLocale::setDefault(QLocale::C);.br    d = QString( "1234,56" ).toDouble(&ok); // ok == false.br    d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56.br.br    QLocale::setDefault(QLocale::German);.br    d = QString( "1234,56" ).toDouble(&ok); // ok == true, d == 1234.56.br    d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56.br.br    QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));.br    str = QString( "%1 %L2 %L3" ).br            .arg( 12345 ).br            .arg( 12345 ).br            .arg( 12345, 0, 16 );.br    // str == "12345 12,345 3039".br.fi.PPWhen a language/country pair is specified in the constructor, one of three things can happen:.TPIf the language/country pair is found in the database, it is used..TPIf the language is found but the country is not, or if the country is AnyCountry, the language is used with the most appropriate available country (for example, Germany for German),.TPIf neither the language nor the country are found, QLocale defaults to the default locale (see setDefault())..PPThe "C" locale is identical to English/UnitedStates..PPUse language() and country() to determine the actual language and country values used..PPAn alternative method for constructing a QLocale object is by specifying the locale name..PP.nf.br    QLocale korean("ko");.br    QLocale swiss("de_CH");.br.fi.PPThis constructor converts the locale name to a language/country pair; it does not use the system locale database..PPAll the methods in QLocale, with the exception of setDefault(), are reentrant..PPSee also QString::toDouble(), QString::arg(), and Text Related Classes..PPThe double-to-string and string-to-double conversion functions are covered by the following licenses:.PPCopyright (c) 1991 by AT&T..PPPermission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software..PPTHIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE..PPThis product includes software developed by the University of California, Berkeley and its contributors..SS "Member Type Documentation".SH "QLocale::Country"This enumerated type is used to specify a country..TP\fCQLocale::AnyCountry\fR.TP\fCQLocale::Afghanistan\fR.TP\fCQLocale::Albania\fR.TP\fCQLocale::Algeria\fR.TP\fCQLocale::AmericanSamoa\fR.TP\fCQLocale::Andorra\fR.TP\fCQLocale::Angola\fR.TP\fCQLocale::Anguilla\fR.TP\fCQLocale::Antarctica\fR.TP\fCQLocale::AntiguaAndBarbuda\fR.TP\fCQLocale::Argentina\fR.TP\fCQLocale::Armenia\fR.TP\fCQLocale::Aruba\fR.TP\fCQLocale::Australia\fR.TP\fCQLocale::Austria\fR.TP\fCQLocale::Azerbaijan\fR.TP\fCQLocale::Bahamas\fR.TP\fCQLocale::Bahrain\fR.TP\fCQLocale::Bangladesh\fR.TP\fCQLocale::Barbados\fR.TP\fCQLocale::Belarus\fR.TP\fCQLocale::Belgium\fR.TP\fCQLocale::Belize\fR.TP\fCQLocale::Benin\fR.TP\fCQLocale::Bermuda\fR.TP\fCQLocale::Bhutan\fR.TP\fCQLocale::Bolivia\fR.TP\fCQLocale::BosniaAndHerzegowina\fR.TP\fCQLocale::Botswana\fR.TP\fCQLocale::BouvetIsland\fR.TP\fCQLocale::Brazil\fR.TP\fCQLocale::BritishIndianOceanTerritory\fR.TP\fCQLocale::BruneiDarussalam\fR.TP\fCQLocale::Bulgaria\fR.TP\fCQLocale::BurkinaFaso\fR.TP\fCQLocale::Burundi\fR.TP\fCQLocale::Cambodia\fR.TP\fCQLocale::Cameroon\fR.TP\fCQLocale::Canada\fR.TP\fCQLocale::CapeVerde\fR.TP\fCQLocale::CaymanIslands\fR.TP\fCQLocale::CentralAfricanRepublic\fR.TP\fCQLocale::Chad\fR.TP\fCQLocale::Chile\fR.TP\fCQLocale::China\fR.TP\fCQLocale::ChristmasIsland\fR.TP\fCQLocale::CocosIslands\fR.TP\fCQLocale::Colombia\fR.TP\fCQLocale::Comoros\fR.TP\fCQLocale::DemocraticRepublicOfCongo\fR.TP\fCQLocale::PeoplesRepublicOfCongo\fR.TP\fCQLocale::CookIslands\fR.TP\fCQLocale::CostaRica\fR.TP\fCQLocale::IvoryCoast\fR.TP\fCQLocale::Croatia\fR.TP\fCQLocale::Cuba\fR.TP\fCQLocale::Cyprus\fR.TP\fCQLocale::CzechRepublic\fR.TP\fCQLocale::Denmark\fR.TP\fCQLocale::Djibouti\fR.TP\fCQLocale::Dominica\fR.TP\fCQLocale::DominicanRepublic\fR.TP\fCQLocale::EastTimor\fR.TP\fCQLocale::Ecuador\fR.TP\fCQLocale::Egypt\fR.TP\fCQLocale::ElSalvador\fR.TP\fCQLocale::EquatorialGuinea\fR.TP\fCQLocale::Eritrea\fR.TP\fCQLocale::Estonia\fR.TP\fCQLocale::Ethiopia\fR.TP\fCQLocale::FalklandIslands\fR.TP\fCQLocale::FaroeIslands\fR.TP\fCQLocale::FijiCountry\fR.TP\fCQLocale::Finland\fR.TP\fCQLocale::France\fR.TP\fCQLocale::MetropolitanFrance\fR.TP\fCQLocale::FrenchGuiana\fR.TP\fCQLocale::FrenchPolynesia\fR.TP\fCQLocale::FrenchSouthernTerritories\fR.TP\fCQLocale::Gabon\fR.TP\fCQLocale::Gambia\fR.TP\fCQLocale::Georgia\fR.TP\fCQLocale::Germany\fR.TP\fCQLocale::Ghana\fR.TP\fCQLocale::Gibraltar\fR.TP\fCQLocale::Greece\fR.TP\fCQLocale::Greenland\fR.TP\fCQLocale::Grenada\fR.TP\fCQLocale::Guadeloupe\fR.TP\fCQLocale::Guam\fR.TP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -