You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
853 lines
43 KiB
853 lines
43 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/tools/qlocale.cpp:1921 -->
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>QLocale Class</title>
|
|
<style type="text/css"><!--
|
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
|
a:link { color: #004faf; text-decoration: none }
|
|
a:visited { color: #672967; text-decoration: none }
|
|
body { background: #ffffff; color: black; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr bgcolor="#E5E5E5">
|
|
<td valign=center>
|
|
<a href="index.html">
|
|
<font color="#004faf">Home</font></a>
|
|
| <a href="classes.html">
|
|
<font color="#004faf">All Classes</font></a>
|
|
| <a href="mainclasses.html">
|
|
<font color="#004faf">Main Classes</font></a>
|
|
| <a href="annotated.html">
|
|
<font color="#004faf">Annotated</font></a>
|
|
| <a href="groups.html">
|
|
<font color="#004faf">Grouped Classes</font></a>
|
|
| <a href="functions.html">
|
|
<font color="#004faf">Functions</font></a>
|
|
</td>
|
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QLocale Class Reference</h1>
|
|
|
|
<p>The QLocale class converts between numbers and their
|
|
string representations in various languages.
|
|
<a href="#details">More...</a>
|
|
<p>Almost all the functions in this class are <a href="threads.html#reentrant">reentrant</a> when Qt is built with thread support. The exception is <a href="#setDefault"><b>setDefault</b></a>().
|
|
</p><p><tt>#include <<a href="qlocale-h.html">qlocale.h</a>></tt>
|
|
<p><a href="qlocale-members.html">List of all member functions.</a>
|
|
<h2>Public Members</h2>
|
|
<ul>
|
|
<li class=fn>enum <a href="#Language-enum"><b>Language</b></a> { 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 }</li>
|
|
<li class=fn>enum <a href="#Country-enum"><b>Country</b></a> { 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 }</li>
|
|
<li class=fn><a href="#QLocale"><b>QLocale</b></a> ()</li>
|
|
<li class=fn><a href="#QLocale-2"><b>QLocale</b></a> ( const QString & name )</li>
|
|
<li class=fn><a href="#QLocale-3"><b>QLocale</b></a> ( Language language, Country country = AnyCountry )</li>
|
|
<li class=fn><a href="#QLocale-4"><b>QLocale</b></a> ( const QLocale & other )</li>
|
|
<li class=fn>QLocale & <a href="#operator-eq"><b>operator=</b></a> ( const QLocale & other )</li>
|
|
<li class=fn>Language <a href="#language"><b>language</b></a> () const</li>
|
|
<li class=fn>Country <a href="#country"><b>country</b></a> () const</li>
|
|
<li class=fn>QString <a href="#name"><b>name</b></a> () const</li>
|
|
<li class=fn>short <a href="#toShort"><b>toShort</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>ushort <a href="#toUShort"><b>toUShort</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>int <a href="#toInt"><b>toInt</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>uint <a href="#toUInt"><b>toUInt</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>Q_LONG <a href="#toLong"><b>toLong</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>Q_ULONG <a href="#toULong"><b>toULong</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>Q_LLONG <a href="#toLongLong"><b>toLongLong</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>Q_ULLONG <a href="#toULongLong"><b>toULongLong</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>float <a href="#toFloat"><b>toFloat</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>double <a href="#toDouble"><b>toDouble</b></a> ( const QString & s, bool * ok = 0 ) const</li>
|
|
<li class=fn>QString <a href="#toString-2"><b>toString</b></a> ( short i ) const</li>
|
|
<li class=fn>QString <a href="#toString-3"><b>toString</b></a> ( ushort i ) const</li>
|
|
<li class=fn>QString <a href="#toString-4"><b>toString</b></a> ( int i ) const</li>
|
|
<li class=fn>QString <a href="#toString-5"><b>toString</b></a> ( uint i ) const</li>
|
|
<li class=fn>QString <a href="#toString-6"><b>toString</b></a> ( Q_LONG i ) const</li>
|
|
<li class=fn>QString <a href="#toString-7"><b>toString</b></a> ( Q_ULONG i ) const</li>
|
|
<li class=fn>QString <a href="#toString"><b>toString</b></a> ( Q_LLONG i ) const</li>
|
|
<li class=fn>QString <a href="#toString-8"><b>toString</b></a> ( Q_ULLONG i ) const</li>
|
|
<li class=fn>QString <a href="#toString-9"><b>toString</b></a> ( float i, char f = 'g', int prec = 6 ) const</li>
|
|
<li class=fn>QString <a href="#toString-a"><b>toString</b></a> ( double i, char f = 'g', int prec = 6 ) const</li>
|
|
</ul>
|
|
<h2>Static Public Members</h2>
|
|
<ul>
|
|
<li class=fn>QString <a href="#languageToString"><b>languageToString</b></a> ( Language language )</li>
|
|
<li class=fn>QString <a href="#countryToString"><b>countryToString</b></a> ( Country country )</li>
|
|
<li class=fn>void <a href="#setDefault"><b>setDefault</b></a> ( const QLocale & locale )</li>
|
|
<li class=fn>QLocale <a href="#c"><b>c</b></a> ()</li>
|
|
<li class=fn>QLocale <a href="#system"><b>system</b></a> ()</li>
|
|
</ul>
|
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
|
|
|
|
|
The QLocale class converts between numbers and their
|
|
string representations in various languages.
|
|
<p>
|
|
|
|
<p> It 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 <a href="qstring.html">QString</a>.
|
|
<p> <pre>
|
|
QLocale egyptian(QLocale::<a href="#Language-enum">Arabic</a>, QLocale::<a href="#Country-enum">Egypt</a>);
|
|
<a href="qstring.html">QString</a> s1 = egyptian.<a href="#toString">toString</a>(1.571429E+07, 'e');
|
|
<a href="qstring.html">QString</a> s2 = egyptian.<a href="#toString">toString</a>(10);
|
|
|
|
double d = egyptian.<a href="#toDouble">toDouble</a>(s1);
|
|
int s2 = egyptian.<a href="#toInt">toInt</a>(s2);
|
|
</pre>
|
|
|
|
<p> QLocale 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 <a href="#setDefault">setDefault</a>(). The default locale has the
|
|
following effects:
|
|
<p> <ul>
|
|
<li> If a QLocale object is constructed with the default constructor,
|
|
it will use the default locale's settings.
|
|
<li> <a href="qstring.html#toDouble">QString::toDouble</a>() interprets the string according to the default
|
|
locale. If this fails, it falls back on the "C" locale.
|
|
<li> <a href="qstring.html#arg">QString::arg</a>() uses the default locale to format a number when
|
|
its position specifier in the format string contains an 'L',
|
|
e.g. "%L1".
|
|
</ul>
|
|
<p> <pre>
|
|
QLocale::<a href="#setDefault">setDefault</a>(<a href="#QLocale">QLocale</a>(QLocale::<a href="#Language-enum">Hebrew</a>, QLocale::<a href="#Country-enum">Israel</a>));
|
|
QLocale hebrew; // Constructs a default QLocale
|
|
<a href="qstring.html">QString</a> s1 = hebrew.<a href="#toString">toString</a>(15714.3, 'e');
|
|
|
|
bool ok;
|
|
double d;
|
|
|
|
QLocale::<a href="#setDefault">setDefault</a>(QLocale::<a href="#Language-enum">C</a>);
|
|
d = QString( "1234,56" ).toDouble(&ok); // ok == false
|
|
d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56
|
|
|
|
QLocale::<a href="#setDefault">setDefault</a>(QLocale::<a href="#Language-enum">German</a>);
|
|
d = QString( "1234,56" ).toDouble(&ok); // ok == true, d == 1234.56
|
|
d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56
|
|
|
|
QLocale::<a href="#setDefault">setDefault</a>(<a href="#QLocale">QLocale</a>(QLocale::<a href="#Language-enum">English</a>, QLocale::<a href="#Country-enum">UnitedStates</a>));
|
|
str = QString( "%1 %L2 %L3" )
|
|
.arg( 12345 )
|
|
.arg( 12345 )
|
|
.arg( 12345, 0, 16 );
|
|
// str == "12345 12,345 3039"
|
|
</pre>
|
|
|
|
<p> When a language/country pair is specified in the constructor, one
|
|
of three things can happen:
|
|
<p> <ul>
|
|
<li> If the language/country pair is found in the database, it is used.
|
|
<li> If the language is found but the country is not, or if the country
|
|
is <a href="#Country-enum">AnyCountry</a>, the language is used with the most
|
|
appropriate available country (for example, Germany for German),
|
|
<li> If neither the language nor the country are found, QLocale
|
|
defaults to the default locale (see <a href="#setDefault">setDefault</a>()).
|
|
</ul>
|
|
<p> The "C" locale is identical to English/UnitedStates.
|
|
<p> Use <a href="#language">language</a>() and <a href="#country">country</a>() to determine the actual language and
|
|
country values used.
|
|
<p> An alternative method for constructing a QLocale object is by
|
|
specifying the locale name.
|
|
<p> <pre>
|
|
QLocale korean("ko");
|
|
QLocale swiss("de_CH");
|
|
</pre>
|
|
|
|
<p> This constructor converts the locale name to a language/country
|
|
pair; it does not use the system locale database.
|
|
<p> All the methods in QLocale, with the exception of setDefault(),
|
|
are reentrant.
|
|
<p> <p>See also <a href="qstring.html#toDouble">QString::toDouble</a>(), <a href="qstring.html#arg">QString::arg</a>(), and <a href="text.html">Text Related Classes</a>.
|
|
|
|
<p> The double-to-string and string-to-double conversion functions are
|
|
covered by the following licenses:
|
|
<p>
|
|
<p> Copyright (c) 1991 by AT&T.
|
|
<p> Permission 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.
|
|
<p> THIS 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.
|
|
<p> This product includes software developed by the University of
|
|
California, Berkeley and its contributors.
|
|
|
|
<hr><h2>Member Type Documentation</h2>
|
|
<h3 class=fn><a name="Country-enum"></a>QLocale::Country</h3>
|
|
|
|
<p> This enumerated type is used to specify a country.
|
|
<ul>
|
|
<li><tt>QLocale::AnyCountry</tt>
|
|
<li><tt>QLocale::Afghanistan</tt>
|
|
<li><tt>QLocale::Albania</tt>
|
|
<li><tt>QLocale::Algeria</tt>
|
|
<li><tt>QLocale::AmericanSamoa</tt>
|
|
<li><tt>QLocale::Andorra</tt>
|
|
<li><tt>QLocale::Angola</tt>
|
|
<li><tt>QLocale::Anguilla</tt>
|
|
<li><tt>QLocale::Antarctica</tt>
|
|
<li><tt>QLocale::AntiguaAndBarbuda</tt>
|
|
<li><tt>QLocale::Argentina</tt>
|
|
<li><tt>QLocale::Armenia</tt>
|
|
<li><tt>QLocale::Aruba</tt>
|
|
<li><tt>QLocale::Australia</tt>
|
|
<li><tt>QLocale::Austria</tt>
|
|
<li><tt>QLocale::Azerbaijan</tt>
|
|
<li><tt>QLocale::Bahamas</tt>
|
|
<li><tt>QLocale::Bahrain</tt>
|
|
<li><tt>QLocale::Bangladesh</tt>
|
|
<li><tt>QLocale::Barbados</tt>
|
|
<li><tt>QLocale::Belarus</tt>
|
|
<li><tt>QLocale::Belgium</tt>
|
|
<li><tt>QLocale::Belize</tt>
|
|
<li><tt>QLocale::Benin</tt>
|
|
<li><tt>QLocale::Bermuda</tt>
|
|
<li><tt>QLocale::Bhutan</tt>
|
|
<li><tt>QLocale::Bolivia</tt>
|
|
<li><tt>QLocale::BosniaAndHerzegowina</tt>
|
|
<li><tt>QLocale::Botswana</tt>
|
|
<li><tt>QLocale::BouvetIsland</tt>
|
|
<li><tt>QLocale::Brazil</tt>
|
|
<li><tt>QLocale::BritishIndianOceanTerritory</tt>
|
|
<li><tt>QLocale::BruneiDarussalam</tt>
|
|
<li><tt>QLocale::Bulgaria</tt>
|
|
<li><tt>QLocale::BurkinaFaso</tt>
|
|
<li><tt>QLocale::Burundi</tt>
|
|
<li><tt>QLocale::Cambodia</tt>
|
|
<li><tt>QLocale::Cameroon</tt>
|
|
<li><tt>QLocale::Canada</tt>
|
|
<li><tt>QLocale::CapeVerde</tt>
|
|
<li><tt>QLocale::CaymanIslands</tt>
|
|
<li><tt>QLocale::CentralAfricanRepublic</tt>
|
|
<li><tt>QLocale::Chad</tt>
|
|
<li><tt>QLocale::Chile</tt>
|
|
<li><tt>QLocale::China</tt>
|
|
<li><tt>QLocale::ChristmasIsland</tt>
|
|
<li><tt>QLocale::CocosIslands</tt>
|
|
<li><tt>QLocale::Colombia</tt>
|
|
<li><tt>QLocale::Comoros</tt>
|
|
<li><tt>QLocale::DemocraticRepublicOfCongo</tt>
|
|
<li><tt>QLocale::PeoplesRepublicOfCongo</tt>
|
|
<li><tt>QLocale::CookIslands</tt>
|
|
<li><tt>QLocale::CostaRica</tt>
|
|
<li><tt>QLocale::IvoryCoast</tt>
|
|
<li><tt>QLocale::Croatia</tt>
|
|
<li><tt>QLocale::Cuba</tt>
|
|
<li><tt>QLocale::Cyprus</tt>
|
|
<li><tt>QLocale::CzechRepublic</tt>
|
|
<li><tt>QLocale::Denmark</tt>
|
|
<li><tt>QLocale::Djibouti</tt>
|
|
<li><tt>QLocale::Dominica</tt>
|
|
<li><tt>QLocale::DominicanRepublic</tt>
|
|
<li><tt>QLocale::EastTimor</tt>
|
|
<li><tt>QLocale::Ecuador</tt>
|
|
<li><tt>QLocale::Egypt</tt>
|
|
<li><tt>QLocale::ElSalvador</tt>
|
|
<li><tt>QLocale::EquatorialGuinea</tt>
|
|
<li><tt>QLocale::Eritrea</tt>
|
|
<li><tt>QLocale::Estonia</tt>
|
|
<li><tt>QLocale::Ethiopia</tt>
|
|
<li><tt>QLocale::FalklandIslands</tt>
|
|
<li><tt>QLocale::FaroeIslands</tt>
|
|
<li><tt>QLocale::FijiCountry</tt>
|
|
<li><tt>QLocale::Finland</tt>
|
|
<li><tt>QLocale::France</tt>
|
|
<li><tt>QLocale::MetropolitanFrance</tt>
|
|
<li><tt>QLocale::FrenchGuiana</tt>
|
|
<li><tt>QLocale::FrenchPolynesia</tt>
|
|
<li><tt>QLocale::FrenchSouthernTerritories</tt>
|
|
<li><tt>QLocale::Gabon</tt>
|
|
<li><tt>QLocale::Gambia</tt>
|
|
<li><tt>QLocale::Georgia</tt>
|
|
<li><tt>QLocale::Germany</tt>
|
|
<li><tt>QLocale::Ghana</tt>
|
|
<li><tt>QLocale::Gibraltar</tt>
|
|
<li><tt>QLocale::Greece</tt>
|
|
<li><tt>QLocale::Greenland</tt>
|
|
<li><tt>QLocale::Grenada</tt>
|
|
<li><tt>QLocale::Guadeloupe</tt>
|
|
<li><tt>QLocale::Guam</tt>
|
|
<li><tt>QLocale::Guatemala</tt>
|
|
<li><tt>QLocale::Guinea</tt>
|
|
<li><tt>QLocale::GuineaBissau</tt>
|
|
<li><tt>QLocale::Guyana</tt>
|
|
<li><tt>QLocale::Haiti</tt>
|
|
<li><tt>QLocale::HeardAndMcDonaldIslands</tt>
|
|
<li><tt>QLocale::Honduras</tt>
|
|
<li><tt>QLocale::HongKong</tt>
|
|
<li><tt>QLocale::Hungary</tt>
|
|
<li><tt>QLocale::Iceland</tt>
|
|
<li><tt>QLocale::India</tt>
|
|
<li><tt>QLocale::Indonesia</tt>
|
|
<li><tt>QLocale::Iran</tt>
|
|
<li><tt>QLocale::Iraq</tt>
|
|
<li><tt>QLocale::Ireland</tt>
|
|
<li><tt>QLocale::Israel</tt>
|
|
<li><tt>QLocale::Italy</tt>
|
|
<li><tt>QLocale::Jamaica</tt>
|
|
<li><tt>QLocale::Japan</tt>
|
|
<li><tt>QLocale::Jordan</tt>
|
|
<li><tt>QLocale::Kazakhstan</tt>
|
|
<li><tt>QLocale::Kenya</tt>
|
|
<li><tt>QLocale::Kiribati</tt>
|
|
<li><tt>QLocale::DemocraticRepublicOfKorea</tt>
|
|
<li><tt>QLocale::RepublicOfKorea</tt>
|
|
<li><tt>QLocale::Kuwait</tt>
|
|
<li><tt>QLocale::Kyrgyzstan</tt>
|
|
<li><tt>QLocale::Lao</tt>
|
|
<li><tt>QLocale::Latvia</tt>
|
|
<li><tt>QLocale::Lebanon</tt>
|
|
<li><tt>QLocale::Lesotho</tt>
|
|
<li><tt>QLocale::Liberia</tt>
|
|
<li><tt>QLocale::LibyanArabJamahiriya</tt>
|
|
<li><tt>QLocale::Liechtenstein</tt>
|
|
<li><tt>QLocale::Lithuania</tt>
|
|
<li><tt>QLocale::Luxembourg</tt>
|
|
<li><tt>QLocale::Macau</tt>
|
|
<li><tt>QLocale::Macedonia</tt>
|
|
<li><tt>QLocale::Madagascar</tt>
|
|
<li><tt>QLocale::Malawi</tt>
|
|
<li><tt>QLocale::Malaysia</tt>
|
|
<li><tt>QLocale::Maldives</tt>
|
|
<li><tt>QLocale::Mali</tt>
|
|
<li><tt>QLocale::Malta</tt>
|
|
<li><tt>QLocale::MarshallIslands</tt>
|
|
<li><tt>QLocale::Martinique</tt>
|
|
<li><tt>QLocale::Mauritania</tt>
|
|
<li><tt>QLocale::Mauritius</tt>
|
|
<li><tt>QLocale::Mayotte</tt>
|
|
<li><tt>QLocale::Mexico</tt>
|
|
<li><tt>QLocale::Micronesia</tt>
|
|
<li><tt>QLocale::Moldova</tt>
|
|
<li><tt>QLocale::Monaco</tt>
|
|
<li><tt>QLocale::Mongolia</tt>
|
|
<li><tt>QLocale::Montserrat</tt>
|
|
<li><tt>QLocale::Morocco</tt>
|
|
<li><tt>QLocale::Mozambique</tt>
|
|
<li><tt>QLocale::Myanmar</tt>
|
|
<li><tt>QLocale::Namibia</tt>
|
|
<li><tt>QLocale::NauruCountry</tt>
|
|
<li><tt>QLocale::Nepal</tt>
|
|
<li><tt>QLocale::Netherlands</tt>
|
|
<li><tt>QLocale::NetherlandsAntilles</tt>
|
|
<li><tt>QLocale::NewCaledonia</tt>
|
|
<li><tt>QLocale::NewZealand</tt>
|
|
<li><tt>QLocale::Nicaragua</tt>
|
|
<li><tt>QLocale::Niger</tt>
|
|
<li><tt>QLocale::Nigeria</tt>
|
|
<li><tt>QLocale::Niue</tt>
|
|
<li><tt>QLocale::NorfolkIsland</tt>
|
|
<li><tt>QLocale::NorthernMarianaIslands</tt>
|
|
<li><tt>QLocale::Norway</tt>
|
|
<li><tt>QLocale::Oman</tt>
|
|
<li><tt>QLocale::Pakistan</tt>
|
|
<li><tt>QLocale::Palau</tt>
|
|
<li><tt>QLocale::PalestinianTerritory</tt>
|
|
<li><tt>QLocale::Panama</tt>
|
|
<li><tt>QLocale::PapuaNewGuinea</tt>
|
|
<li><tt>QLocale::Paraguay</tt>
|
|
<li><tt>QLocale::Peru</tt>
|
|
<li><tt>QLocale::Philippines</tt>
|
|
<li><tt>QLocale::Pitcairn</tt>
|
|
<li><tt>QLocale::Poland</tt>
|
|
<li><tt>QLocale::Portugal</tt>
|
|
<li><tt>QLocale::PuertoRico</tt>
|
|
<li><tt>QLocale::Qatar</tt>
|
|
<li><tt>QLocale::Reunion</tt>
|
|
<li><tt>QLocale::Romania</tt>
|
|
<li><tt>QLocale::RussianFederation</tt>
|
|
<li><tt>QLocale::Rwanda</tt>
|
|
<li><tt>QLocale::SaintKittsAndNevis</tt>
|
|
<li><tt>QLocale::StLucia</tt>
|
|
<li><tt>QLocale::StVincentAndTheGrenadines</tt>
|
|
<li><tt>QLocale::Samoa</tt>
|
|
<li><tt>QLocale::SanMarino</tt>
|
|
<li><tt>QLocale::SaoTomeAndPrincipe</tt>
|
|
<li><tt>QLocale::SaudiArabia</tt>
|
|
<li><tt>QLocale::Senegal</tt>
|
|
<li><tt>QLocale::Seychelles</tt>
|
|
<li><tt>QLocale::SierraLeone</tt>
|
|
<li><tt>QLocale::Singapore</tt>
|
|
<li><tt>QLocale::Slovakia</tt>
|
|
<li><tt>QLocale::Slovenia</tt>
|
|
<li><tt>QLocale::SolomonIslands</tt>
|
|
<li><tt>QLocale::Somalia</tt>
|
|
<li><tt>QLocale::SouthAfrica</tt>
|
|
<li><tt>QLocale::SouthGeorgiaAndTheSouthSandwichIslands</tt>
|
|
<li><tt>QLocale::Spain</tt>
|
|
<li><tt>QLocale::SriLanka</tt>
|
|
<li><tt>QLocale::StHelena</tt>
|
|
<li><tt>QLocale::StPierreAndMiquelon</tt>
|
|
<li><tt>QLocale::Sudan</tt>
|
|
<li><tt>QLocale::Suriname</tt>
|
|
<li><tt>QLocale::SvalbardAndJanMayenIslands</tt>
|
|
<li><tt>QLocale::Swaziland</tt>
|
|
<li><tt>QLocale::Sweden</tt>
|
|
<li><tt>QLocale::Switzerland</tt>
|
|
<li><tt>QLocale::SyrianArabRepublic</tt>
|
|
<li><tt>QLocale::Taiwan</tt>
|
|
<li><tt>QLocale::Tajikistan</tt>
|
|
<li><tt>QLocale::Tanzania</tt>
|
|
<li><tt>QLocale::Thailand</tt>
|
|
<li><tt>QLocale::Togo</tt>
|
|
<li><tt>QLocale::Tokelau</tt>
|
|
<li><tt>QLocale::TongaCountry</tt>
|
|
<li><tt>QLocale::TrinidadAndTobago</tt>
|
|
<li><tt>QLocale::Tunisia</tt>
|
|
<li><tt>QLocale::Turkey</tt>
|
|
<li><tt>QLocale::Turkmenistan</tt>
|
|
<li><tt>QLocale::TurksAndCaicosIslands</tt>
|
|
<li><tt>QLocale::Tuvalu</tt>
|
|
<li><tt>QLocale::Uganda</tt>
|
|
<li><tt>QLocale::Ukraine</tt>
|
|
<li><tt>QLocale::UnitedArabEmirates</tt>
|
|
<li><tt>QLocale::UnitedKingdom</tt>
|
|
<li><tt>QLocale::UnitedStates</tt>
|
|
<li><tt>QLocale::UnitedStatesMinorOutlyingIslands</tt>
|
|
<li><tt>QLocale::Uruguay</tt>
|
|
<li><tt>QLocale::Uzbekistan</tt>
|
|
<li><tt>QLocale::Vanuatu</tt>
|
|
<li><tt>QLocale::VaticanCityState</tt>
|
|
<li><tt>QLocale::Venezuela</tt>
|
|
<li><tt>QLocale::VietNam</tt>
|
|
<li><tt>QLocale::BritishVirginIslands</tt>
|
|
<li><tt>QLocale::USVirginIslands</tt>
|
|
<li><tt>QLocale::WallisAndFutunaIslands</tt>
|
|
<li><tt>QLocale::WesternSahara</tt>
|
|
<li><tt>QLocale::Yemen</tt>
|
|
<li><tt>QLocale::Yugoslavia</tt>
|
|
<li><tt>QLocale::Zambia</tt>
|
|
<li><tt>QLocale::Zimbabwe</tt>
|
|
</ul>
|
|
<h3 class=fn><a name="Language-enum"></a>QLocale::Language</h3>
|
|
|
|
<p> This enumerated type is used to specify a language.
|
|
<ul>
|
|
<li><tt>QLocale::C</tt> - Identical to English/UnitedStates
|
|
<li><tt>QLocale::Abkhazian</tt>
|
|
<li><tt>QLocale::Afan</tt>
|
|
<li><tt>QLocale::Afar</tt>
|
|
<li><tt>QLocale::Afrikaans</tt>
|
|
<li><tt>QLocale::Albanian</tt>
|
|
<li><tt>QLocale::Amharic</tt>
|
|
<li><tt>QLocale::Arabic</tt>
|
|
<li><tt>QLocale::Armenian</tt>
|
|
<li><tt>QLocale::Assamese</tt>
|
|
<li><tt>QLocale::Aymara</tt>
|
|
<li><tt>QLocale::Azerbaijani</tt>
|
|
<li><tt>QLocale::Bashkir</tt>
|
|
<li><tt>QLocale::Basque</tt>
|
|
<li><tt>QLocale::Bengali</tt>
|
|
<li><tt>QLocale::Bhutani</tt>
|
|
<li><tt>QLocale::Bihari</tt>
|
|
<li><tt>QLocale::Bislama</tt>
|
|
<li><tt>QLocale::Breton</tt>
|
|
<li><tt>QLocale::Bulgarian</tt>
|
|
<li><tt>QLocale::Burmese</tt>
|
|
<li><tt>QLocale::Byelorussian</tt>
|
|
<li><tt>QLocale::Cambodian</tt>
|
|
<li><tt>QLocale::Catalan</tt>
|
|
<li><tt>QLocale::Chinese</tt>
|
|
<li><tt>QLocale::Corsican</tt>
|
|
<li><tt>QLocale::Croatian</tt>
|
|
<li><tt>QLocale::Czech</tt>
|
|
<li><tt>QLocale::Danish</tt>
|
|
<li><tt>QLocale::Dutch</tt>
|
|
<li><tt>QLocale::English</tt>
|
|
<li><tt>QLocale::Esperanto</tt>
|
|
<li><tt>QLocale::Estonian</tt>
|
|
<li><tt>QLocale::Faroese</tt>
|
|
<li><tt>QLocale::FijiLanguage</tt>
|
|
<li><tt>QLocale::Finnish</tt>
|
|
<li><tt>QLocale::French</tt>
|
|
<li><tt>QLocale::Frisian</tt>
|
|
<li><tt>QLocale::Gaelic</tt>
|
|
<li><tt>QLocale::Galician</tt>
|
|
<li><tt>QLocale::Georgian</tt>
|
|
<li><tt>QLocale::German</tt>
|
|
<li><tt>QLocale::Greek</tt>
|
|
<li><tt>QLocale::Greenlandic</tt>
|
|
<li><tt>QLocale::Guarani</tt>
|
|
<li><tt>QLocale::Gujarati</tt>
|
|
<li><tt>QLocale::Hausa</tt>
|
|
<li><tt>QLocale::Hebrew</tt>
|
|
<li><tt>QLocale::Hindi</tt>
|
|
<li><tt>QLocale::Hungarian</tt>
|
|
<li><tt>QLocale::Icelandic</tt>
|
|
<li><tt>QLocale::Indonesian</tt>
|
|
<li><tt>QLocale::Interlingua</tt>
|
|
<li><tt>QLocale::Interlingue</tt>
|
|
<li><tt>QLocale::Inuktitut</tt>
|
|
<li><tt>QLocale::Inupiak</tt>
|
|
<li><tt>QLocale::Irish</tt>
|
|
<li><tt>QLocale::Italian</tt>
|
|
<li><tt>QLocale::Japanese</tt>
|
|
<li><tt>QLocale::Javanese</tt>
|
|
<li><tt>QLocale::Kannada</tt>
|
|
<li><tt>QLocale::Kashmiri</tt>
|
|
<li><tt>QLocale::Kazakh</tt>
|
|
<li><tt>QLocale::Kinyarwanda</tt>
|
|
<li><tt>QLocale::Kirghiz</tt>
|
|
<li><tt>QLocale::Korean</tt>
|
|
<li><tt>QLocale::Kurdish</tt>
|
|
<li><tt>QLocale::Kurundi</tt>
|
|
<li><tt>QLocale::Laothian</tt>
|
|
<li><tt>QLocale::Latin</tt>
|
|
<li><tt>QLocale::Latvian</tt>
|
|
<li><tt>QLocale::Lingala</tt>
|
|
<li><tt>QLocale::Lithuanian</tt>
|
|
<li><tt>QLocale::Macedonian</tt>
|
|
<li><tt>QLocale::Malagasy</tt>
|
|
<li><tt>QLocale::Malay</tt>
|
|
<li><tt>QLocale::Malayalam</tt>
|
|
<li><tt>QLocale::Maltese</tt>
|
|
<li><tt>QLocale::Maori</tt>
|
|
<li><tt>QLocale::Marathi</tt>
|
|
<li><tt>QLocale::Moldavian</tt>
|
|
<li><tt>QLocale::Mongolian</tt>
|
|
<li><tt>QLocale::NauruLanguage</tt>
|
|
<li><tt>QLocale::Nepali</tt>
|
|
<li><tt>QLocale::Norwegian</tt>
|
|
<li><tt>QLocale::Occitan</tt>
|
|
<li><tt>QLocale::Oriya</tt>
|
|
<li><tt>QLocale::Pashto</tt>
|
|
<li><tt>QLocale::Persian</tt>
|
|
<li><tt>QLocale::Polish</tt>
|
|
<li><tt>QLocale::Portuguese</tt>
|
|
<li><tt>QLocale::Punjabi</tt>
|
|
<li><tt>QLocale::Quechua</tt>
|
|
<li><tt>QLocale::RhaetoRomance</tt>
|
|
<li><tt>QLocale::Romanian</tt>
|
|
<li><tt>QLocale::Russian</tt>
|
|
<li><tt>QLocale::Samoan</tt>
|
|
<li><tt>QLocale::Sangho</tt>
|
|
<li><tt>QLocale::Sanskrit</tt>
|
|
<li><tt>QLocale::Serbian</tt>
|
|
<li><tt>QLocale::SerboCroatian</tt>
|
|
<li><tt>QLocale::Sesotho</tt>
|
|
<li><tt>QLocale::Setswana</tt>
|
|
<li><tt>QLocale::Shona</tt>
|
|
<li><tt>QLocale::Sindhi</tt>
|
|
<li><tt>QLocale::Singhalese</tt>
|
|
<li><tt>QLocale::Siswati</tt>
|
|
<li><tt>QLocale::Slovak</tt>
|
|
<li><tt>QLocale::Slovenian</tt>
|
|
<li><tt>QLocale::Somali</tt>
|
|
<li><tt>QLocale::Spanish</tt>
|
|
<li><tt>QLocale::Sundanese</tt>
|
|
<li><tt>QLocale::Swahili</tt>
|
|
<li><tt>QLocale::Swedish</tt>
|
|
<li><tt>QLocale::Tagalog</tt>
|
|
<li><tt>QLocale::Tajik</tt>
|
|
<li><tt>QLocale::Tamil</tt>
|
|
<li><tt>QLocale::Tatar</tt>
|
|
<li><tt>QLocale::Telugu</tt>
|
|
<li><tt>QLocale::Thai</tt>
|
|
<li><tt>QLocale::Tibetan</tt>
|
|
<li><tt>QLocale::Tigrinya</tt>
|
|
<li><tt>QLocale::TongaLanguage</tt>
|
|
<li><tt>QLocale::Tsonga</tt>
|
|
<li><tt>QLocale::Turkish</tt>
|
|
<li><tt>QLocale::Turkmen</tt>
|
|
<li><tt>QLocale::Twi</tt>
|
|
<li><tt>QLocale::Uigur</tt>
|
|
<li><tt>QLocale::Ukrainian</tt>
|
|
<li><tt>QLocale::Urdu</tt>
|
|
<li><tt>QLocale::Uzbek</tt>
|
|
<li><tt>QLocale::Vietnamese</tt>
|
|
<li><tt>QLocale::Volapuk</tt>
|
|
<li><tt>QLocale::Welsh</tt>
|
|
<li><tt>QLocale::Wolof</tt>
|
|
<li><tt>QLocale::Xhosa</tt>
|
|
<li><tt>QLocale::Yiddish</tt>
|
|
<li><tt>QLocale::Yoruba</tt>
|
|
<li><tt>QLocale::Zhuang</tt>
|
|
<li><tt>QLocale::Zulu</tt>
|
|
</ul>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<h3 class=fn><a name="QLocale"></a>QLocale::QLocale ()
|
|
</h3>
|
|
Constructs a QLocale object initialized with the default locale.
|
|
<p> <p>See also <a href="#setDefault">setDefault</a>().
|
|
|
|
<h3 class=fn><a name="QLocale-2"></a>QLocale::QLocale ( const <a href="qstring.html">QString</a> & name )
|
|
</h3>
|
|
Constructs a QLocale object with the specified <em>name</em>,
|
|
which has the format
|
|
"language[_country][.codeset][@modifier]" or "C", where:
|
|
<p> <ul>
|
|
<li> language is a lowercase, two-letter, ISO 639 language code,
|
|
<li> territory is an uppercase, two-letter, ISO 3166 country code,
|
|
<li> and codeset and modifier are ignored.
|
|
</ul>
|
|
<p> 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.
|
|
<p> The language and country codes are converted to their respective
|
|
<a href="#Language-enum">Language</a> and <a href="#Country-enum">Country</a> enums. After this conversion is
|
|
performed the constructor behaves exactly like QLocale(Country,
|
|
Language).
|
|
<p> This constructor is much slower than QLocale(Country, Language).
|
|
<p> <p>See also <a href="#name">name</a>().
|
|
|
|
<h3 class=fn><a name="QLocale-3"></a>QLocale::QLocale ( <a href="qlocale.html#Language-enum">Language</a> language, <a href="qlocale.html#Country-enum">Country</a> country = AnyCountry )
|
|
</h3>
|
|
Constructs a QLocale object with the specified <em>language</em> and <em>country</em>.
|
|
<p> <ul>
|
|
<li> If the language/country pair is found in the database, it is used.
|
|
<li> If the language is found but the country is not, or if the country
|
|
is <a href="#Country-enum">AnyCountry</a>, the language is used with the most
|
|
appropriate available country (for example, Germany for German),
|
|
<li> If neither the language nor the country are found, QLocale
|
|
defaults to the default locale (see <a href="#setDefault">setDefault</a>()).
|
|
</ul>
|
|
<p> The language and country that are actually used can be queried
|
|
using <a href="#language">language</a>() and <a href="#country">country</a>().
|
|
<p> <p>See also <a href="#setDefault">setDefault</a>(), <a href="#language">language</a>(), and <a href="#country">country</a>().
|
|
|
|
<h3 class=fn><a name="QLocale-4"></a>QLocale::QLocale ( const <a href="qlocale.html">QLocale</a> & other )
|
|
</h3>
|
|
Constructs a QLocale object as a copy of <em>other</em>.
|
|
|
|
<h3 class=fn><a href="qlocale.html">QLocale</a> <a name="c"></a>QLocale::c ()<tt> [static]</tt>
|
|
</h3>
|
|
|
|
<p> Returns a QLocale object initialized to the "C" locale.
|
|
<p> <p>See also <a href="#system">system</a>().
|
|
|
|
<h3 class=fn><a href="qlocale.html#Country-enum">Country</a> <a name="country"></a>QLocale::country () const
|
|
</h3>
|
|
Returns the country of this locale.
|
|
<p> <p>See also <a href="#QLocale">QLocale</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="countryToString"></a>QLocale::countryToString ( <a href="qlocale.html#Country-enum">Country</a> country )<tt> [static]</tt>
|
|
</h3>
|
|
Returns a <a href="qstring.html">QString</a> containing the name of <em>country</em>.
|
|
|
|
<h3 class=fn><a href="qlocale.html#Language-enum">Language</a> <a name="language"></a>QLocale::language () const
|
|
</h3>
|
|
Returns the language of this locale.
|
|
<p> <p>See also <a href="#QLocale">QLocale</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="languageToString"></a>QLocale::languageToString ( <a href="qlocale.html#Language-enum">Language</a> language )<tt> [static]</tt>
|
|
</h3>
|
|
Returns a <a href="qstring.html">QString</a> containing the name of <em>language</em>.
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="name"></a>QLocale::name () const
|
|
</h3>
|
|
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.
|
|
<p> <p>See also <a href="#QLocale">QLocale</a>().
|
|
|
|
<h3 class=fn><a href="qlocale.html">QLocale</a> & <a name="operator-eq"></a>QLocale::operator= ( const <a href="qlocale.html">QLocale</a> & other )
|
|
</h3>
|
|
Assigns <em>other</em> to this QLocale object and returns a reference
|
|
to this QLocale object.
|
|
|
|
<h3 class=fn>void <a name="setDefault"></a>QLocale::setDefault ( const <a href="qlocale.html">QLocale</a> & locale )<tt> [static]</tt>
|
|
</h3><p><b>Warning:</b> This function is <i>not</i> <a href="threads.html#reentrant">reentrant</a>.</p>
|
|
|
|
|
|
<p> Sets the global default locale to <em>locale</em>. 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.
|
|
<p> <b>Warning:</b> In a multithreaded application, the default locale
|
|
should be set at application startup, before any non-GUI threads
|
|
are created.
|
|
<p> <p>See also <a href="#system">system</a>() and <a href="#c">c</a>().
|
|
|
|
<h3 class=fn><a href="qlocale.html">QLocale</a> <a name="system"></a>QLocale::system ()<tt> [static]</tt>
|
|
</h3>
|
|
Returns a QLocale object initialized to the system locale.
|
|
|
|
<h3 class=fn>double <a name="toDouble"></a>QLocale::toDouble ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the double represented by the localized string <em>s</em>, or
|
|
0.0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> Unlike <a href="qstring.html#toDouble">QString::toDouble</a>(), this function does not fall back to
|
|
the "C" locale if the string cannot be interpreted in this
|
|
locale.
|
|
<p> <pre>
|
|
bool ok;
|
|
double d;
|
|
|
|
QLocale c(QLocale::<a href="#Language-enum">C</a>);
|
|
d = c.<a href="#toDouble">toDouble</a>( "1234.56", &ok ); // ok == true, d == 1234.56
|
|
d = c.<a href="#toDouble">toDouble</a>( "1,234.56", &ok ); // ok == true, d == 1234.56
|
|
d = c.<a href="#toDouble">toDouble</a>( "1234,56", &ok ); // ok == false
|
|
|
|
QLocale german(QLocale::<a href="#Language-enum">German</a>);
|
|
d = german.<a href="#toDouble">toDouble</a>( "1234,56", &ok ); // ok == true, d == 1234.56
|
|
d = german.<a href="#toDouble">toDouble</a>( "1.234,56", &ok ); // ok == true, d == 1234.56
|
|
d = german.<a href="#toDouble">toDouble</a>( "1234.56", &ok ); // ok == false
|
|
|
|
d = german.<a href="#toDouble">toDouble</a>( "1.234", &ok ); // ok == true, d == 1234.0
|
|
</pre>
|
|
|
|
<p> Notice that the last conversion returns 1234.0, because '.' is the
|
|
thousands group separator in the German locale.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>() and <a href="qstring.html#toDouble">QString::toDouble</a>().
|
|
|
|
<h3 class=fn>float <a name="toFloat"></a>QLocale::toFloat ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the float represented by the localized string <em>s</em>, or 0.0
|
|
if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>int <a name="toInt"></a>QLocale::toInt ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the int represented by the localized string <em>s</em>, or 0 if
|
|
the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting *ok to false and
|
|
success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>Q_LONG <a name="toLong"></a>QLocale::toLong ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the long int represented by the localized string <em>s</em>, or
|
|
0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>Q_LLONG <a name="toLongLong"></a>QLocale::toLongLong ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the long long int represented by the localized string <em>s</em>, or 0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>short <a name="toShort"></a>QLocale::toShort ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the short int represented by the localized string <em>s</em>, or
|
|
0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString"></a>QLocale::toString ( Q_LLONG i ) const
|
|
</h3>
|
|
Returns a localized string representation of <em>i</em>.
|
|
<p> <p>See also <a href="#toLongLong">toLongLong</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-2"></a>QLocale::toString ( short i ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toShort">toShort</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-3"></a>QLocale::toString ( ushort i ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toUShort">toUShort</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-4"></a>QLocale::toString ( int i ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toInt">toInt</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-5"></a>QLocale::toString ( uint i ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toUInt">toUInt</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-6"></a>QLocale::toString ( Q_LONG i ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toLong">toLong</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-7"></a>QLocale::toString ( Q_ULONG i ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toULong">toULong</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-8"></a>QLocale::toString ( Q_ULLONG i ) const
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <p>See also <a href="#toULongLong">toULongLong</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-9"></a>QLocale::toString ( float i, char f = 'g', int prec = 6 ) const
|
|
</h3>
|
|
|
|
<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <em>f</em> and <em>prec</em> have the same meaning as in <a href="qstring.html#number">QString::number</a>(double, char, int).
|
|
<p> <p>See also <a href="#toDouble">toDouble</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">QString</a> <a name="toString-a"></a>QLocale::toString ( double i, char f = 'g', int prec = 6 ) const
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <em>f</em> and <em>prec</em> have the same meaning as in <a href="qstring.html#number">QString::number</a>(double, char, int).
|
|
<p> <p>See also <a href="#toDouble">toDouble</a>().
|
|
|
|
<h3 class=fn>uint <a name="toUInt"></a>QLocale::toUInt ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the unsigned int represented by the localized string <em>s</em>,
|
|
or 0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>Q_ULONG <a name="toULong"></a>QLocale::toULong ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the unsigned long int represented by the localized string
|
|
<em>s</em>, or 0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>Q_ULLONG <a name="toULongLong"></a>QLocale::toULongLong ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the unsigned long long int represented by the localized
|
|
string <em>s</em>, or 0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<h3 class=fn>ushort <a name="toUShort"></a>QLocale::toUShort ( const <a href="qstring.html">QString</a> & s, bool * ok = 0 ) const
|
|
</h3>
|
|
Returns the unsigned short int represented by the localized string
|
|
<em>s</em>, or 0 if the conversion failed.
|
|
<p> If <em>ok</em> is not 0, reports failure by setting
|
|
*ok to false and success by setting *ok to true.
|
|
<p> This function ignores leading and trailing whitespace.
|
|
<p> <p>See also <a href="#toString">toString</a>().
|
|
|
|
<!-- eof -->
|
|
<hr><p>
|
|
This file is part of the <a href="index.html">Qt toolkit</a>.
|
|
Copyright © 1995-2007
|
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
|
<table width=100% cellspacing=0 border=0><tr>
|
|
<td>Copyright © 2007
|
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
|
<td align=right><div align=right>Qt 3.3.8</div>
|
|
</table></div></address></body>
|
|
</html>
|