QLocale Class Reference

The QLocale class converts between numbers and their string representations in various languages.

  1. #include <QLocale>

Note: All functions in this class are reentrant, except for setDefault(), which is nonreentrant.

Detailed Description

The QLocale class converts between numbers and their string representations in various languages.

QLocale is initialized with a language/country pair in its constructor and offers number-to-string and string-to-number conversion functions similar to those in QString.

Example:

  1. QLocale egyptian(QLocale::Arabic, QLocale::Egypt);
  2. QString s1 = egyptian.toString(1.571429E+07, 'e');
  3. QString s2 = egyptian.toString(10);
  4.  
  5. double d = egyptian.toDouble(s1);
  6. int i = egyptian.toInt(s2);

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 setDefault(). Setting the default locale has the following effects:

  • If a QLocale object is constructed with the default constructor, it will use the default locale's settings.
  • QString::toInt(), QString::toDouble(), etc., interpret the string according to the default locale. If this fails, it falls back on the "C" locale.
  • QString::arg() uses the default locale to format a number when its position specifier in the format string contains an 'L', e.g. "%L1".

The following example illustrates how to use QLocale directly:

  1. QLocale::setDefault(QLocale(QLocale::Hebrew, QLocale::Israel));
  2. QLocale hebrew; // Constructs a default QLocale
  3. QString s1 = hebrew.toString(15714.3, 'e');
  4.  
  5. bool ok;
  6. double d;
  7.  
  8. QLocale::setDefault(QLocale::C);
  9. d = QString("1234,56").toDouble(&ok);   // ok == false
  10. d = QString("1234.56").toDouble(&ok);   // ok == true, d == 1234.56
  11.  
  12. QLocale::setDefault(QLocale::German);
  13. d = QString("1234,56").toDouble(&ok);   // ok == true, d == 1234.56
  14. d = QString("1234.56").toDouble(&ok);   // ok == true, d == 1234.56
  15.  
  16. QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
  17. str = QString("%1 %L2 %L3")
  18.       .arg(12345).arg(12345).arg(12345, 0, 16);
  19. // str == "12345 12,345 3039"

When a language/country pair is specified in the constructor, one of three things can happen:

  • If the language/country pair is found in the database, it is used.
  • If 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),
  • If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault()).

Use language() and country() to determine the actual language and country values used.

An alternative method for constructing a QLocale object is by specifying the locale name.

  1. QLocale korean("ko");
  2. QLocale swiss("de_CH");

This constructor converts the locale name to a language/country pair; it does not use the system locale database.

QLocale's data is based on Common Locale Data Repository v1.8.1.

The double-to-string and string-to-double conversion functions are covered by the following licenses:

Copyright (c) 1991 by AT&T.

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.

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.

This product includes software developed by the University of California, Berkeley and its contributors.

See also QString::arg(), QString::toInt(), and QString::toDouble().

Public Types

Toggle detailsenum QLocale::

CountryCountry { AnyCountry , Afghanistan , Albania , Algeria , AmericanSamoa , Andorra , Angola , Anguilla , Antarctica , AntiguaAndBarbuda , Argentina , Armenia , Aruba , Australia , Austria , Azerbaijan , Bahamas , Bahrain , Bangladesh , Barbados , Belarus , Belgium , Belize , Benin , Bermuda , Bhutan , Bolivia , BosniaAndHerzegowina , Botswana , BouvetIsland , Brazil , BritishIndianOceanTerritory , BruneiDarussalam , Bulgaria , BurkinaFaso , Burundi , Cambodia , Cameroon , Canada , CapeVerde , CaymanIslands , CentralAfricanRepublic , Chad , Chile , China , ChristmasIsland , CocosIslands , Colombia , Comoros , DemocraticRepublicOfCongo , PeoplesRepublicOfCongo , CookIslands , CostaRica , IvoryCoast , Croatia , Cuba , Cyprus , CzechRepublic , Denmark , Djibouti , Dominica , DominicanRepublic , EastTimor , Ecuador , Egypt , ElSalvador , EquatorialGuinea , Eritrea , Estonia , Ethiopia , FalklandIslands , FaroeIslands , FijiCountry , Finland , France , MetropolitanFrance , FrenchGuiana , FrenchPolynesia , FrenchSouthernTerritories , Gabon , Gambia , Georgia , Germany , Ghana , Gibraltar , Greece , Greenland , Grenada , Guadeloupe , Guam , Guatemala , Guinea , GuineaBissau , Guyana , Haiti , HeardAndMcDonaldIslands , Honduras , HongKong , Hungary , Iceland , India , Indonesia , Iran , Iraq , Ireland , Israel , Italy , Jamaica , Japan , Jordan , Kazakhstan , Kenya , Kiribati , DemocraticRepublicOfKorea , RepublicOfKorea , Kuwait , Kyrgyzstan , Lao , Latvia , Lebanon , Lesotho , Liberia , LibyanArabJamahiriya , Liechtenstein , Lithuania , Luxembourg , Macau , Macedonia , Madagascar , Malawi , Malaysia , Maldives , Mali , Malta , MarshallIslands , Martinique , Mauritania , Mauritius , Mayotte , Mexico , Micronesia , Moldova , Monaco , Mongolia , Montserrat , Morocco , Mozambique , Myanmar , Namibia , NauruCountry , Nepal , Netherlands , NetherlandsAntilles , NewCaledonia , NewZealand , Nicaragua , Niger , Nigeria , Niue , NorfolkIsland , NorthernMarianaIslands , Norway , Oman , Pakistan , Palau , PalestinianTerritory , Panama , PapuaNewGuinea , Paraguay , Peru , Philippines , Pitcairn , Poland , Portugal , PuertoRico , Qatar , Reunion , Romania , RussianFederation , Rwanda , SaintKittsAndNevis , StLucia , StVincentAndTheGrenadines , Samoa , SanMarino , SaoTomeAndPrincipe , SaudiArabia , Senegal , Seychelles , SierraLeone , Singapore , Slovakia , Slovenia , SolomonIslands , Somalia , SouthAfrica , SouthGeorgiaAndTheSouthSandwichIslands , Spain , SriLanka , StHelena , StPierreAndMiquelon , Sudan , Suriname , SvalbardAndJanMayenIslands , Swaziland , Sweden , Switzerland , SyrianArabRepublic , Taiwan , Tajikistan , Tanzania , Thailand , Togo , Tokelau , TongaCountry , TrinidadAndTobago , Tunisia , Turkey , Turkmenistan , TurksAndCaicosIslands , Tuvalu , Uganda , Ukraine , UnitedArabEmirates , UnitedKingdom , UnitedStates , UnitedStatesMinorOutlyingIslands , Uruguay , Uzbekistan , Vanuatu , VaticanCityState , Venezuela , VietNam , BritishVirginIslands , USVirginIslands , WallisAndFutunaIslands , WesternSahara , Yemen , Yugoslavia , Zambia , Zimbabwe , SerbiaAndMontenegro , Montenegro , Serbia , SaintBarthelemy , SaintMartin , LatinAmericaAndTheCaribbean , LastCountry LatinAmericaAndTheCaribbean ...} { AnyCountry , Afghanistan , Albania , Algeria , AmericanSamoa , Andorra , Angola , Anguilla , Antarctica , AntiguaAndBarbuda , Argentina , Armenia , Aruba , Australia , Austria , Azerbaijan , Bahamas , Bahrain , Bangladesh , Barbados , Belarus , Belgium , Belize , Benin , Bermuda , Bhutan , Bolivia , BosniaAndHerzegowina , Botswana , BouvetIsland , Brazil , BritishIndianOceanTerritory , BruneiDarussalam , Bulgaria , BurkinaFaso , Burundi , Cambodia , Cameroon , Canada , CapeVerde , CaymanIslands , CentralAfricanRepublic , Chad , Chile , China , ChristmasIsland , CocosIslands , Colombia , Comoros , DemocraticRepublicOfCongo , PeoplesRepublicOfCongo , CookIslands , CostaRica , IvoryCoast , Croatia , Cuba , Cyprus , CzechRepublic , Denmark , Djibouti , Dominica , DominicanRepublic , EastTimor , Ecuador , Egypt , ElSalvador , EquatorialGuinea , Eritrea , Estonia , Ethiopia , FalklandIslands , FaroeIslands , FijiCountry , Finland , France , MetropolitanFrance , FrenchGuiana , FrenchPolynesia , FrenchSouthernTerritories , Gabon , Gambia , Georgia , Germany , Ghana , Gibraltar , Greece , Greenland , Grenada , Guadeloupe , Guam , Guatemala , Guinea , GuineaBissau , Guyana , Haiti , HeardAndMcDonaldIslands , Honduras , HongKong , Hungary , Iceland , India , Indonesia , Iran , Iraq , Ireland , Israel , Italy , Jamaica , Japan , Jordan , Kazakhstan , Kenya , Kiribati , DemocraticRepublicOfKorea , RepublicOfKorea , Kuwait , Kyrgyzstan , Lao , Latvia , Lebanon , Lesotho , Liberia , LibyanArabJamahiriya , Liechtenstein , Lithuania , Luxembourg , Macau , Macedonia , Madagascar , Malawi , Malaysia , Maldives , Mali , Malta , MarshallIslands , Martinique , Mauritania , Mauritius , Mayotte , Mexico , Micronesia , Moldova , Monaco , Mongolia , Montserrat , Morocco , Mozambique , Myanmar , Namibia , NauruCountry , Nepal , Netherlands , NetherlandsAntilles , NewCaledonia , NewZealand , Nicaragua , Niger , Nigeria , Niue , NorfolkIsland , NorthernMarianaIslands , Norway , Oman , Pakistan , Palau , PalestinianTerritory , Panama , PapuaNewGuinea , Paraguay , Peru , Philippines , Pitcairn , Poland , Portugal , PuertoRico , Qatar , Reunion , Romania , RussianFederation , Rwanda , SaintKittsAndNevis , StLucia , StVincentAndTheGrenadines , Samoa , SanMarino , SaoTomeAndPrincipe , SaudiArabia , Senegal , Seychelles , SierraLeone , Singapore , Slovakia , Slovenia , SolomonIslands , Somalia , SouthAfrica , SouthGeorgiaAndTheSouthSandwichIslands , Spain , SriLanka , StHelena , StPierreAndMiquelon , Sudan , Suriname , SvalbardAndJanMayenIslands , Swaziland , Sweden , Switzerland , SyrianArabRepublic , Taiwan , Tajikistan , Tanzania , Thailand , Togo , Tokelau , TongaCountry , TrinidadAndTobago , Tunisia , Turkey , Turkmenistan , TurksAndCaicosIslands , Tuvalu , Uganda , Ukraine , UnitedArabEmirates , UnitedKingdom , UnitedStates , UnitedStatesMinorOutlyingIslands , Uruguay , Uzbekistan , Vanuatu , VaticanCityState , Venezuela , VietNam , BritishVirginIslands , USVirginIslands , WallisAndFutunaIslands , WesternSahara , Yemen , Yugoslavia , Zambia , Zimbabwe , SerbiaAndMontenegro , Montenegro , Serbia , SaintBarthelemy , SaintMartin , LatinAmericaAndTheCaribbean , LastCountry LatinAmericaAndTheCaribbean }

This enumerated type is used to specify a country.

ConstantValue
QLocale::AnyCountry 0
QLocale::Afghanistan 1
QLocale::Albania 2
QLocale::Algeria 3
QLocale::AmericanSamoa 4
QLocale::Andorra 5
QLocale::Angola 6
QLocale::Anguilla 7
QLocale::Antarctica 8
QLocale::AntiguaAndBarbuda 9
QLocale::Argentina 10
QLocale::Armenia 11
QLocale::Aruba 12
QLocale::Australia 13
QLocale::Austria 14
QLocale::Azerbaijan 15
QLocale::Bahamas 16
QLocale::Bahrain 17
QLocale::Bangladesh 18
QLocale::Barbados 19
QLocale::Belarus 20
QLocale::Belgium 21
QLocale::Belize 22
QLocale::Benin 23
QLocale::Bermuda 24
QLocale::Bhutan 25
QLocale::Bolivia 26
QLocale::BosniaAndHerzegowina 27
QLocale::Botswana 28
QLocale::BouvetIsland 29
QLocale::Brazil 30
QLocale::BritishIndianOceanTerritory 31
QLocale::BruneiDarussalam 32
QLocale::Bulgaria 33
QLocale::BurkinaFaso 34
QLocale::Burundi 35
QLocale::Cambodia 36
QLocale::Cameroon 37
QLocale::Canada 38
QLocale::CapeVerde 39
QLocale::CaymanIslands 40
QLocale::CentralAfricanRepublic 41
QLocale::Chad 42
QLocale::Chile 43
QLocale::China 44
QLocale::ChristmasIsland 45
QLocale::CocosIslands 46
QLocale::Colombia 47
QLocale::Comoros 48
QLocale::DemocraticRepublicOfCongo 49
QLocale::PeoplesRepublicOfCongo 50
QLocale::CookIslands 51
QLocale::CostaRica 52
QLocale::IvoryCoast 53
QLocale::Croatia 54
QLocale::Cuba 55
QLocale::Cyprus 56
QLocale::CzechRepublic 57
QLocale::Denmark 58
QLocale::Djibouti 59
QLocale::Dominica 60
QLocale::DominicanRepublic 61
QLocale::EastTimor 62
QLocale::Ecuador 63
QLocale::Egypt 64
QLocale::ElSalvador 65
QLocale::EquatorialGuinea 66
QLocale::Eritrea 67
QLocale::Estonia 68
QLocale::Ethiopia 69
QLocale::FalklandIslands 70
QLocale::FaroeIslands 71
QLocale::FijiCountry 72
QLocale::Finland 73
QLocale::France 74
QLocale::MetropolitanFrance 75
QLocale::FrenchGuiana 76
QLocale::FrenchPolynesia 77
QLocale::FrenchSouthernTerritories 78
QLocale::Gabon 79
QLocale::Gambia 80
QLocale::Georgia 81
QLocale::Germany 82
QLocale::Ghana 83
QLocale::Gibraltar 84
QLocale::Greece 85
QLocale::Greenland 86
QLocale::Grenada 87
QLocale::Guadeloupe 88
QLocale::Guam 89
QLocale::Guatemala 90
QLocale::Guinea 91
QLocale::GuineaBissau 92
QLocale::Guyana 93
QLocale::Haiti 94
QLocale::HeardAndMcDonaldIslands 95
QLocale::Honduras 96
QLocale::HongKong 97
QLocale::Hungary 98
QLocale::Iceland 99
QLocale::India 100
QLocale::Indonesia 101
QLocale::Iran 102
QLocale::Iraq 103
QLocale::Ireland 104
QLocale::Israel 105
QLocale::Italy 106
QLocale::Jamaica 107
QLocale::Japan 108
QLocale::Jordan 109
QLocale::Kazakhstan 110
QLocale::Kenya 111
QLocale::Kiribati 112
QLocale::DemocraticRepublicOfKorea 113
QLocale::RepublicOfKorea 114
QLocale::Kuwait 115
QLocale::Kyrgyzstan 116
QLocale::Lao 117
QLocale::Latvia 118
QLocale::Lebanon 119
QLocale::Lesotho 120
QLocale::Liberia 121
QLocale::LibyanArabJamahiriya 122
QLocale::Liechtenstein 123
QLocale::Lithuania 124
QLocale::Luxembourg 125
QLocale::Macau 126
QLocale::Macedonia 127
QLocale::Madagascar 128
QLocale::Malawi 129
QLocale::Malaysia 130
QLocale::Maldives 131
QLocale::Mali 132
QLocale::Malta 133
QLocale::MarshallIslands 134
QLocale::Martinique 135
QLocale::Mauritania 136
QLocale::Mauritius 137
QLocale::Mayotte 138
QLocale::Mexico 139
QLocale::Micronesia 140
QLocale::Moldova 141
QLocale::Monaco 142
QLocale::Mongolia 143
QLocale::Montserrat 144
QLocale::Morocco 145
QLocale::Mozambique 146
QLocale::Myanmar 147
QLocale::Namibia 148
QLocale::NauruCountry 149
QLocale::Nepal 150
QLocale::Netherlands 151
QLocale::NetherlandsAntilles 152
QLocale::NewCaledonia 153
QLocale::NewZealand 154
QLocale::Nicaragua 155
QLocale::Niger 156
QLocale::Nigeria 157
QLocale::Niue 158
QLocale::NorfolkIsland 159
QLocale::NorthernMarianaIslands 160
QLocale::Norway 161
QLocale::Oman 162
QLocale::Pakistan 163
QLocale::Palau 164
QLocale::PalestinianTerritory 165
QLocale::Panama 166
QLocale::PapuaNewGuinea 167
QLocale::Paraguay 168
QLocale::Peru 169
QLocale::Philippines 170
QLocale::Pitcairn 171
QLocale::Poland 172
QLocale::Portugal 173
QLocale::PuertoRico 174
QLocale::Qatar 175
QLocale::Reunion 176
QLocale::Romania 177
QLocale::RussianFederation 178
QLocale::Rwanda 179
QLocale::SaintKittsAndNevis 180
QLocale::StLucia 181
QLocale::StVincentAndTheGrenadines 182
QLocale::Samoa 183
QLocale::SanMarino 184
QLocale::SaoTomeAndPrincipe 185
QLocale::SaudiArabia 186
QLocale::Senegal 187
QLocale::SerbiaAndMontenegro 241
QLocale::Seychelles 188
QLocale::SierraLeone 189
QLocale::Singapore 190
QLocale::Slovakia 191
QLocale::Slovenia 192
QLocale::SolomonIslands 193
QLocale::Somalia 194
QLocale::SouthAfrica 195
QLocale::SouthGeorgiaAndTheSouthSandwichIslands 196
QLocale::Spain 197
QLocale::SriLanka 198
QLocale::StHelena 199
QLocale::StPierreAndMiquelon 200
QLocale::Sudan 201
QLocale::Suriname 202
QLocale::SvalbardAndJanMayenIslands 203
QLocale::Swaziland 204
QLocale::Sweden 205
QLocale::Switzerland 206
QLocale::SyrianArabRepublic 207
QLocale::Taiwan 208
QLocale::Tajikistan 209
QLocale::Tanzania 210
QLocale::Thailand 211
QLocale::Togo 212
QLocale::Tokelau 213
QLocale::TongaCountry 214
QLocale::TrinidadAndTobago 215
QLocale::Tunisia 216
QLocale::Turkey 217
QLocale::Turkmenistan 218
QLocale::TurksAndCaicosIslands 219
QLocale::Tuvalu 220
QLocale::Uganda 221
QLocale::Ukraine 222
QLocale::UnitedArabEmirates 223
QLocale::UnitedKingdom 224
QLocale::UnitedStates 225
QLocale::UnitedStatesMinorOutlyingIslands 226
QLocale::Uruguay 227
QLocale::Uzbekistan 228
QLocale::Vanuatu 229
QLocale::VaticanCityState 230
QLocale::Venezuela 231
QLocale::VietNam 232
QLocale::BritishVirginIslands 233
QLocale::USVirginIslands 234
QLocale::WallisAndFutunaIslands 235
QLocale::WesternSahara 236
QLocale::Yemen 237
QLocale::Yugoslavia 238
QLocale::Zambia 239
QLocale::Zimbabwe 240
QLocale::SerbiaAndMontenegro 241
QLocale::Montenegro 242
QLocale::Serbia 243
QLocale::SaintBarthelemy 244
QLocale::SaintMartin 245
QLocale::LatinAmericaAndTheCaribbean 246

See also country().

Look up this member in the source code.

Toggle detailsenum QLocale::

FormatTypeFormatType { LongFormat , ShortFormat , NarrowFormat 2 ...} { LongFormat , ShortFormat , NarrowFormat 2 }

This enum describes the types of format that can be used when converting QDate and QTime objects to strings.

ConstantValueDescription
QLocale::LongFormat 0 The long version of day and month names; for example, returning "January" as a month name.
QLocale::ShortFormat 1 The short version of day and month names; for example, returning "Jan" as a month name.
QLocale::NarrowFormat 2 A special version of day and month names for use when space is limited; for example, returning "J" as a month name. Note that the narrow format might contain the same text for different months and days or it can even be an empty string if the locale doesn't support narrow names, so you should avoid using it for date formatting. Also, for the system locale this format is the same as ShortFormat.

Look up this member in the source code.

Toggle detailsenum QLocale::

LanguageLanguage { C , Abkhazian , Afan , Afar , Afrikaans , Albanian , Amharic , Arabic , Armenian , Assamese , Aymara , Azerbaijani , Bashkir , Basque , Bengali , Bhutani , Bihari , Bislama , Breton , Bulgarian , Burmese , Byelorussian , Cambodian , Catalan , Chinese , Corsican , Croatian , Czech , Danish , Dutch , English , Esperanto , Estonian , Faroese , FijiLanguage , Finnish , French , Frisian , Gaelic , Galician , Georgian , German , Greek , Greenlandic , Guarani , Gujarati , Hausa , Hebrew , Hindi , Hungarian , Icelandic , Indonesian , Interlingua , Interlingue , Inuktitut , Inupiak , Irish , Italian , Japanese , Javanese , Kannada , Kashmiri , Kazakh , Kinyarwanda , Kirghiz , Korean , Kurdish , Kurundi , Laothian , Latin , Latvian , Lingala , Lithuanian , Macedonian , Malagasy , Malay , Malayalam , Maltese , Maori , Marathi , Moldavian , Mongolian , NauruLanguage , Nepali , Norwegian , NorwegianBokmal , Occitan , Oriya , Pashto , Persian , Polish , Portuguese , Punjabi , Quechua , RhaetoRomance , Romanian , Russian , Samoan , Sangho , Sanskrit , Serbian , SerboCroatian , Sesotho , Setswana , Shona , Sindhi , Singhalese , Siswati , Slovak , Slovenian , Somali , Spanish , Sundanese , Swahili , Swedish , Tagalog , Tajik , Tamil , Tatar , Telugu , Thai , Tibetan , Tigrinya , TongaLanguage , Tsonga , Turkish , Turkmen , Twi , Uigur , Ukrainian , Urdu , Uzbek , Vietnamese , Volapuk , Welsh , Wolof , Xhosa , Yiddish , Yoruba , Zhuang , Zulu , NorwegianNynorsk , Nynorsk , Bosnian , Divehi , Manx , Cornish , Akan , Konkani , Ga , Igbo , Kamba , Syriac , Blin , Geez , Koro , Sidamo , Atsam , Tigre , Jju , Friulian , Venda , Ewe , Walamo , Hawaiian , Tyap , Chewa , Filipino , SwissGerman , SichuanYi , Kpelle , LowGerman , SouthNdebele , NorthernSotho , NorthernSami , Taroko , Gusii , Taita , Fulah , Kikuyu , Samburu , Sena , NorthNdebele , Rombo , Tachelhit , Kabyle , Nyankole , Bena , Vunjo , Bambara , Embu , Cherokee , Morisyen , Makonde , Langi , Ganda , Bemba , Kabuverdianu , Meru , Kalenjin , Nama , Machame , Colognian , Masai , Soga , Luyia , Asu , Teso , Saho , KoyraChiini , Rwa , Luo , Chiga , CentralMoroccoTamazight , KoyraboroSenni , Shambala , LastLanguage Shambala ...} { C , Abkhazian , Afan , Afar , Afrikaans , Albanian , Amharic , Arabic , Armenian , Assamese , Aymara , Azerbaijani , Bashkir , Basque , Bengali , Bhutani , Bihari , Bislama , Breton , Bulgarian , Burmese , Byelorussian , Cambodian , Catalan , Chinese , Corsican , Croatian , Czech , Danish , Dutch , English , Esperanto , Estonian , Faroese , FijiLanguage , Finnish , French , Frisian , Gaelic , Galician , Georgian , German , Greek , Greenlandic , Guarani , Gujarati , Hausa , Hebrew , Hindi , Hungarian , Icelandic , Indonesian , Interlingua , Interlingue , Inuktitut , Inupiak , Irish , Italian , Japanese , Javanese , Kannada , Kashmiri , Kazakh , Kinyarwanda , Kirghiz , Korean , Kurdish , Kurundi , Laothian , Latin , Latvian , Lingala , Lithuanian , Macedonian , Malagasy , Malay , Malayalam , Maltese , Maori , Marathi , Moldavian , Mongolian , NauruLanguage , Nepali , Norwegian , NorwegianBokmal , Occitan , Oriya , Pashto , Persian , Polish , Portuguese , Punjabi , Quechua , RhaetoRomance , Romanian , Russian , Samoan , Sangho , Sanskrit , Serbian , SerboCroatian , Sesotho , Setswana , Shona , Sindhi , Singhalese , Siswati , Slovak , Slovenian , Somali , Spanish , Sundanese , Swahili , Swedish , Tagalog , Tajik , Tamil , Tatar , Telugu , Thai , Tibetan , Tigrinya , TongaLanguage , Tsonga , Turkish , Turkmen , Twi , Uigur , Ukrainian , Urdu , Uzbek , Vietnamese , Volapuk , Welsh , Wolof , Xhosa , Yiddish , Yoruba , Zhuang , Zulu , NorwegianNynorsk , Nynorsk , Bosnian , Divehi , Manx , Cornish , Akan , Konkani , Ga , Igbo , Kamba , Syriac , Blin , Geez , Koro , Sidamo , Atsam , Tigre , Jju , Friulian , Venda , Ewe , Walamo , Hawaiian , Tyap , Chewa , Filipino , SwissGerman , SichuanYi , Kpelle , LowGerman , SouthNdebele , NorthernSotho , NorthernSami , Taroko , Gusii , Taita , Fulah , Kikuyu , Samburu , Sena , NorthNdebele , Rombo , Tachelhit , Kabyle , Nyankole , Bena , Vunjo , Bambara , Embu , Cherokee , Morisyen , Makonde , Langi , Ganda , Bemba , Kabuverdianu , Meru , Kalenjin , Nama , Machame , Colognian , Masai , Soga , Luyia , Asu , Teso , Saho , KoyraChiini , Rwa , Luo , Chiga , CentralMoroccoTamazight , KoyraboroSenni , Shambala , LastLanguage Shambala }

This enumerated type is used to specify a language.

ConstantValueDescription
QLocale::C 1 The "C" locale is identical in behavior to English/UnitedStates.
QLocale::Abkhazian 2
QLocale::Afan 3
QLocale::Afar 4
QLocale::Afrikaans 5
QLocale::Albanian 6
QLocale::Amharic 7
QLocale::Arabic 8
QLocale::Armenian 9
QLocale::Assamese 10
QLocale::Aymara 11
QLocale::Azerbaijani 12
QLocale::Bashkir 13
QLocale::Basque 14
QLocale::Bengali 15
QLocale::Bhutani 16
QLocale::Bihari 17
QLocale::Bislama 18
QLocale::Bosnian 142
QLocale::Breton 19
QLocale::Bulgarian 20
QLocale::Burmese 21
QLocale::Byelorussian 22
QLocale::Cambodian 23
QLocale::Catalan 24
QLocale::Chinese 25
QLocale::Cornish 145
QLocale::Corsican 26
QLocale::Croatian 27
QLocale::Czech 28
QLocale::Danish 29
QLocale::Divehi 143
QLocale::Dutch 30
QLocale::English 31
QLocale::Esperanto 32
QLocale::Estonian 33
QLocale::Faroese 34
QLocale::FijiLanguage 35
QLocale::Finnish 36
QLocale::French 37
QLocale::Frisian 38
QLocale::Gaelic 39
QLocale::Galician 40
QLocale::Georgian 41
QLocale::German 42
QLocale::Greek 43
QLocale::Greenlandic 44
QLocale::Guarani 45
QLocale::Gujarati 46
QLocale::Hausa 47
QLocale::Hebrew 48
QLocale::Hindi 49
QLocale::Hungarian 50
QLocale::Icelandic 51
QLocale::Indonesian 52
QLocale::Interlingua 53
QLocale::Interlingue 54
QLocale::Inuktitut 55
QLocale::Inupiak 56
QLocale::Irish 57
QLocale::Italian 58
QLocale::Japanese 59
QLocale::Javanese 60
QLocale::Kannada 61
QLocale::Kashmiri 62
QLocale::Kazakh 63
QLocale::Kinyarwanda 64
QLocale::Kirghiz 65
QLocale::Korean 66
QLocale::Kurdish 67
QLocale::Kurundi 68
QLocale::Laothian 69
QLocale::Latin 70
QLocale::Latvian 71
QLocale::Lingala 72
QLocale::Lithuanian 73
QLocale::Macedonian 74
QLocale::Malagasy 75
QLocale::Malay 76
QLocale::Malayalam 77
QLocale::Maltese 78
QLocale::Manx 144
QLocale::Maori 79
QLocale::Marathi 80
QLocale::Moldavian 81
QLocale::Mongolian 82
QLocale::NauruLanguage 83
QLocale::Nepali 84
QLocale::Norwegian 85
QLocale::NorwegianBokmal Norwegian
QLocale::Nynorsk NorwegianNynorsk Obsolete, please use NorwegianNynorsk
QLocale::NorwegianNynorsk 141
QLocale::Occitan 86
QLocale::Oriya 87
QLocale::Pashto 88
QLocale::Persian 89
QLocale::Polish 90
QLocale::Portuguese 91
QLocale::Punjabi 92
QLocale::Quechua 93
QLocale::RhaetoRomance 94
QLocale::Romanian 95
QLocale::Russian 96
QLocale::Samoan 97
QLocale::Sangho 98
QLocale::Sanskrit 99
QLocale::Serbian 100
QLocale::SerboCroatian 101
QLocale::Sesotho 102
QLocale::Setswana 103
QLocale::Shona 104
QLocale::Sindhi 105
QLocale::Singhalese 106
QLocale::Siswati 107
QLocale::Slovak 108
QLocale::Slovenian 109
QLocale::Somali 110
QLocale::Spanish 111
QLocale::Sundanese 112
QLocale::Swahili 113
QLocale::Swedish 114
QLocale::Tagalog 115
QLocale::Tajik 116
QLocale::Tamil 117
QLocale::Tatar 118
QLocale::Telugu 119
QLocale::Thai 120
QLocale::Tibetan 121
QLocale::Tigrinya 122
QLocale::TongaLanguage 123
QLocale::Tsonga 124
QLocale::Turkish 125
QLocale::Turkmen 126
QLocale::Twi 127
QLocale::Uigur 128
QLocale::Ukrainian 129
QLocale::Urdu 130
QLocale::Uzbek 131
QLocale::Vietnamese 132
QLocale::Volapuk 133
QLocale::Welsh 134
QLocale::Wolof 135
QLocale::Xhosa 136
QLocale::Yiddish 137
QLocale::Yoruba 138
QLocale::Zhuang 139
QLocale::Zulu 140
QLocale::Bosnian 142
QLocale::Divehi 143
QLocale::Manx 144
QLocale::Cornish 145
QLocale::Akan 146
QLocale::Konkani 147
QLocale::Ga 148
QLocale::Igbo 149
QLocale::Kamba 150
QLocale::Syriac 151
QLocale::Blin 152
QLocale::Geez 153
QLocale::Koro 154
QLocale::Sidamo 155
QLocale::Atsam 156
QLocale::Tigre 157
QLocale::Jju 158
QLocale::Friulian 159
QLocale::Venda 160
QLocale::Ewe 161
QLocale::Walamo 162
QLocale::Hawaiian 163
QLocale::Tyap 164
QLocale::Chewa 165
QLocale::Filipino 166
QLocale::SwissGerman 167
QLocale::SichuanYi 168
QLocale::Kpelle 169
QLocale::LowGerman 170
QLocale::SouthNdebele 171
QLocale::NorthernSotho 172
QLocale::NorthernSami 173
QLocale::Taroko 174
QLocale::Gusii 175
QLocale::Taita 176
QLocale::Fulah 177
QLocale::Kikuyu 178
QLocale::Samburu 179
QLocale::Sena 180
QLocale::NorthNdebele 181
QLocale::Rombo 182
QLocale::Tachelhit 183
QLocale::Kabyle 184
QLocale::Nyankole 185
QLocale::Bena 186
QLocale::Vunjo 187
QLocale::Bambara 188
QLocale::Embu 189
QLocale::Cherokee 190
QLocale::Morisyen 191
QLocale::Makonde 192
QLocale::Langi 193
QLocale::Ganda 194
QLocale::Bemba 195
QLocale::Kabuverdianu 196
QLocale::Meru 197
QLocale::Kalenjin 198
QLocale::Nama 199
QLocale::Machame 200
QLocale::Colognian 201
QLocale::Masai 202
QLocale::Soga 203
QLocale::Luyia 204
QLocale::Asu 205
QLocale::Teso 206
QLocale::Saho 207
QLocale::KoyraChiini 208
QLocale::Rwa 209
QLocale::Luo 210
QLocale::Chiga 211
QLocale::CentralMoroccoTamazight 212
QLocale::KoyraboroSenni 213
QLocale::Shambala 214

See also language().

Look up this member in the source code.

Toggle detailsenum QLocale::

MeasurementSystemMeasurementSystem { MetricSystem , ImperialSystem 1 ...} { MetricSystem , ImperialSystem 1 }

This enum defines which units are used for measurement.

ConstantValueDescription
QLocale::MetricSystem 0 This value indicates metric units, such as meters, centimeters and millimeters.
QLocale::ImperialSystem 1 This value indicates imperial units, such as inches and miles. There are several distinct imperial systems in the world; this value stands for the official United States imperial units.

Look up this member in the source code.

Toggle detailsenum QLocale::

NumberOptionNumberOption { OmitGroupSeparator , RejectGroupSeparator 0x02 ...} { OmitGroupSeparator , RejectGroupSeparator 0x02 }

This enum defines a set of options for number-to-string and string-to-number conversions. They can be retrieved with numberOptions() and set with setNumberOptions().

ConstantValueDescription
QLocale::OmitGroupSeparator 0x01 If this option is set, the number-to-string functions will not insert group separators in their return values. The default is to insert group separators.
QLocale::RejectGroupSeparator 0x02 If this option is set, the string-to-number functions will fail if they encounter group separators in their input. The default is to accept numbers containing correctly placed group separators.

See also setNumberOptions() and numberOptions().

Look up this member in the source code.

    Public Functions

    Toggle details QLocale

    QLocaleQLocale () ()

    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().

    See also setDefault().

    Look up this member in the source code.

    Toggle details QLocale

    QLocaleQLocale ( const QString &name ) ( const QString &name )

    Constructs a QLocale object with the specified name, which has the format "language[_territory][.codeset][@modifier]" or "C", where:

    • language is a lowercase, two-letter, ISO 639 language code,
    • territory is an uppercase, two-letter, ISO 3166 country code,
    • and codeset and modifier are ignored.

    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 Language and Country enums. After this conversion is performed the constructor behaves exactly like QLocale(Country, Language).

    This constructor is much slower than QLocale(Country, Language).

    See also name().

    Look up this member in the source code.

    Toggle details QLocale

    QLocaleQLocale ( Language language , Country country=AnyCountry ...) ( Language language , Country country=AnyCountry )

    Constructs a QLocale object with the specified language and country.

    • If the language/country pair is found in the database, it is used.
    • If 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),
    • If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault()).

    The language and country that are actually used can be queried using language() and country().

    See also setDefault(), language(), and country().

    Look up this member in the source code.

    Toggle details QLocale

    QLocaleQLocale ( const QLocale &other ) ( const QLocale &other )

    Constructs a QLocale object as a copy of other.

    Look up this member in the source code.

    Toggle details QString QLocale

    amTextamText () ()const

    Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hour clock.

    See also pmText().

    Look up this member in the source code.

    Toggle details QLocale QLocale

    cc () () [static]

    Returns a QLocale object initialized to the "C" locale.

    See also system().

    Look up this member in the source code.

    Toggle details QList <Country > QLocale

    countriesForLanguagecountriesForLanguage ( Language language ...) ( Language language ) [static]

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

    Look up this member in the source code.

    Toggle details Country QLocale

    countrycountry () ()const

    Returns the country of this locale.

    See also language(), countryToString(), and name().

    Look up this member in the source code.

    Toggle details QString QLocale

    countryToStringcountryToString ( Country country ) ( Country country ) [static]

    Returns a QString containing the name of country.

    See also country() and name().

    Look up this member in the source code.

    Toggle details QString QLocale

    dateFormatdateFormat ( FormatType format=LongFormat ( FormatType format=LongFormat )const

    Returns the date format used for the current locale.

    If format is LongFormat the format will be a long version. Otherwise it uses a shorter version.

    See also QDate::toString() and QDate::fromString().

    Look up this member in the source code.

    Toggle details QString QLocale

    dateTimeFormatdateTimeFormat ( FormatType format=LongFormat ...) ( FormatType format=LongFormat )const

    Returns the date time format used for the current locale.

    If format is ShortFormat the format will be a short version. Otherwise it uses a longer version.

    See also QDateTime::toString() and QDateTime::fromString().

    Look up this member in the source code.

    Toggle details QString QLocale

    dayNamedayName ( int day , FormatType type=LongFormat ...) ( int day , FormatType type=LongFormat )const

    Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type.

    See also monthName() and standaloneDayName().

    Look up this member in the source code.

    Toggle details QChar QLocale

    decimalPointdecimalPoint () ()const

    Returns the decimal point character of this locale.

    Look up this member in the source code.

    Toggle details QChar QLocale

    exponentialexponential () ()const

    Returns the exponential character of this locale.

    Look up this member in the source code.

    Toggle details QChar QLocale

    groupSeparatorgroupSeparator () ()const

    Returns the group separator character of this locale.

    Look up this member in the source code.

    Toggle details Language QLocale

    languagelanguage () ()const

    Returns the language of this locale.

    See also country(), languageToString(), and name().

    Look up this member in the source code.

    Toggle details QString QLocale

    languageToStringlanguageToString ( Language language ) ( Language language ) [static]

    Returns a QString containing the name of language.

    See also countryToString() and name().

    Look up this member in the source code.

    Toggle details MeasurementSystem QLocale

    measurementSystemmeasurementSystem () ()const

    Returns the measurement system for the locale.

    Look up this member in the source code.

    Toggle details QString QLocale

    monthNamemonthName ( int month , FormatType type=LongFormat ...) ( int month , FormatType type=LongFormat )const

    Returns the localized name of month, in the format specified by type.

    See also dayName() and standaloneMonthName().

    Look up this member in the source code.

    Toggle details QString QLocale

    namename () ()const

    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.

    See also language() and country().

    Look up this member in the source code.

    Toggle details QChar QLocale

    negativeSignnegativeSign () ()const

    Returns the negative sign character of this locale.

    Look up this member in the source code.

    Toggle details NumberOptions QLocale

    numberOptionsnumberOptions () ()const

    Returns the options related to number conversions for this QLocale instance.

    By default, no options are set for the standard locales.

    See also setNumberOptions().

    Look up this member in the source code.

    Toggle details QChar QLocale

    percentpercent () ()const

    Returns the percent character of this locale.

    Look up this member in the source code.

    Toggle details QString QLocale

    pmTextpmText () ()const

    Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hour clock.

    See also amText().

    Look up this member in the source code.

    Toggle details QChar QLocale

    positiveSignpositiveSign () ()const

    Returns the positive sign character of this locale.

    Look up this member in the source code.

    Toggle details void QLocale

    setDefaultsetDefault ( const QLocale &locale ) ( const QLocale &locale ) [static]

    Sets the global default locale to 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.

    See also system() and c().

    Look up this member in the source code.

    Toggle details void QLocale

    setNumberOptionssetNumberOptions ( NumberOptions options ) ( NumberOptions options )

    Sets the options related to number conversions for this QLocale instance.

    See also numberOptions().

    Look up this member in the source code.

    Toggle details QString QLocale

    standaloneDayNamestandaloneDayName ( int day , FormatType type=LongFormat ...) ( int day , FormatType type=LongFormat )const

    Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on) that is used as a standalone text, in the format specified by type.

    If the locale information does not specify the standalone day name then return value is the same as in dayName().

    See also dayName() and standaloneMonthName().

    Look up this member in the source code.

    Toggle details QString QLocale

    standaloneMonthNamestandaloneMonthName ( int month , FormatType type=LongFormat ...) ( int month , FormatType type=LongFormat )const

    Returns the localized name of month that is used as a standalone text, in the format specified by type.

    If the locale information doesn't specify the standalone month name then return value is the same as in monthName().

    See also monthName() and standaloneDayName().

    Look up this member in the source code.

    Toggle details QLocale QLocale

    systemsystem () () [static]

    Returns a QLocale object initialized to the system locale.

    On Windows and Mac, this locale will use the decimal/grouping characters and date/time formats specified in the system configuration panel.

    See also c().

    Look up this member in the source code.

    Toggle details Qt::LayoutDirection QLocale

    textDirectiontextDirection () ()const

    Returns the text direction of the language.

    Look up this member in the source code.

    Toggle details QString QLocale

    timeFormattimeFormat ( FormatType format=LongFormat ( FormatType format=LongFormat )const

    Returns the time format used for the current locale.

    If format is LongFormat the format will be a long version. Otherwise it uses a shorter version.

    See also QTime::toString() and QTime::fromString().

    Look up this member in the source code.

    Toggle details QDate QLocale

    toDatetoDate ( const QString &string , FormatType format=LongFormat ...) ( const QString &string , FormatType format=LongFormat )const

    Parses the date string given in string and returns the date. The format of the date string is chosen according to the format parameter (see dateFormat()).

    If the date could not be parsed, returns an invalid date.

    See also dateFormat(), toTime(), toDateTime(), and QDate::fromString().

    Look up this member in the source code.

    Toggle details QDate QLocale

    toDatetoDate ( const QString &string , const QString &format ...) ( const QString &string , const QString &format )const

    Parses the date string given in string and returns the date. See QDate::fromString() for information on the expressions that can be used with this function.

    This function searches month names and the names of the days of the week in the current locale.

    If the date could not be parsed, returns an invalid date.

    See also dateFormat(), toTime(), toDateTime(), and QDate::fromString().

    Look up this member in the source code.

    Toggle details QDateTime QLocale

    toDateTimetoDateTime ( const QString &string , FormatType format=LongFormat ...) ( const QString &string , FormatType format=LongFormat )const

    Parses the date/time string given in string and returns the time. The format of the date/time string is chosen according to the format parameter (see dateTimeFormat()).

    If the string could not be parsed, returns an invalid QDateTime.

    See also dateTimeFormat(), toTime(), toDate(), and QDateTime::fromString().

    Look up this member in the source code.

    Toggle details QDateTime QLocale

    toDateTimetoDateTime ( const QString &string , const QString &format ...) ( const QString &string , const QString &format )const

    Parses the date/time string given in string and returns the time. See QDateTime::fromString() for information on the expressions that can be used with this function.

    Note: The month and day names used must be given in the user's local language.

    If the string could not be parsed, returns an invalid QDateTime.

    See also dateTimeFormat(), toTime(), toDate(), and QDateTime::fromString().

    Look up this member in the source code.

    Toggle details double QLocale

    toDoubletoDouble ( const QString &s , bool *ok=0 ) ( const QString &s , bool *ok=0 )const

    Returns the double represented by the localized string s, or 0.0 if the conversion failed.

    If ok is not 0, reports failure by setting *ok to false and success by setting *ok to true.

    Unlike QString::toDouble(), this function does not fall back to the "C" locale if the string cannot be interpreted in this locale.

    1. bool ok;
    2. double d;
    3.  
    4. d = c.toDouble( "1234.56", &ok );  // ok == true, d == 1234.56
    5. d = c.toDouble( "1,234.56", &ok ); // ok == true, d == 1234.56
    6. d = c.toDouble( "1234,56", &ok );  // ok == false
    7.  
    8. QLocale german(QLocale::German);
    9. d = german.toDouble( "1234,56", &ok );  // ok == true, d == 1234.56
    10. d = german.toDouble( "1.234,56", &ok ); // ok == true, d == 1234.56
    11. d = german.toDouble( "1234.56", &ok );  // ok == false
    12.  
    13. d = german.toDouble( "1.234", &ok );    // ok == true, d == 1234.0

    Notice that the last conversion returns 1234.0, because '.' is the thousands group separator in the German locale.

    This function ignores leading and trailing whitespace.

    See also toFloat(), toInt(), and toString().

    Look up this member in the source code.

    Toggle details float QLocale

    toFloattoFloat ( const QString &s , bool *ok=0 ) ( const QString &s , bool *ok=0 )const

    Returns the float represented by the localized string s, or 0.0 if the conversion failed.

    If ok is not 0, reports failure by setting *ok to false and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toDouble(), toInt(), and toString().

    Look up this member in the source code.

    Toggle details int QLocale

    toInttoInt ( const QString &s , bool *ok=0 , int base=0 ...) ( const QString &s , bool *ok=0 , int base=0 )const

    Returns the int represented by the localized string s, using base base. If 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 ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toUInt() and toString().

    Look up this member in the source code.

    Toggle details qlonglong QLocale

    toLongLongtoLongLong ( const QString &s , bool *ok=0 , int base=0 ...) ( const QString &s , bool *ok=0 , int base=0 )const

    Returns the long long int represented by the localized string s, using base base. If 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 ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toInt(), toULongLong(), toDouble(), and toString().

    Look up this member in the source code.

    Toggle details short QLocale

    toShorttoShort ( const QString &s , bool *ok=0 , int base=0 ...) ( const QString &s , bool *ok=0 , int base=0 )const

    Returns the short int represented by the localized string s, using base base. If 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 ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toUShort() and toString().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( qlonglong i ) ( qlonglong i )const

    Returns a localized string representation of i.

    See also toLongLong().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( const QDate &date , const QString &format ...) ( const QDate &date , const QString &format )const

    Returns a localized string representation of the given date in the specified format. If format is an empty string, an empty string is returned.

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( const QDate &date , FormatType format=LongFormat ...) ( const QDate &date , FormatType format=LongFormat )const

    Returns a localized string representation of the given date according to the specified format.

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( const QTime &time , const QString &format ...) ( const QTime &time , const QString &format )const

    Returns a localized string representation of the given time according to the specified format. If format is an empty string, an empty string is returned.

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( const QTime &time , FormatType format=LongFormat ...) ( const QTime &time , FormatType format=LongFormat )const

    Returns a localized string representation of the given time in the specified format.

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( const QDateTime &dateTime , FormatType format=LongFormat ...) ( const QDateTime &dateTime , FormatType format=LongFormat )const

    Returns a localized string representation of the given dateTime according to the specified format.

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( const QDateTime &dateTime , const QString &format ...) ( const QDateTime &dateTime , const QString &format )const

    Returns a localized string representation of the given dateTime according to the specified format. If format is an empty string, an empty string is returned.

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( qulonglong i ) ( qulonglong i )const

    This is an overloaded function.

    See also toULongLong().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( double i , charf='g' , int prec=6 ...) ( double i , charf='g' , int prec=6 )const

    This is an overloaded function.

    f and prec have the same meaning as in QString::number(double, char, int).

    See also toDouble().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( shorti ) ( shorti )const

    This is an overloaded function.

    See also toShort().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( ushort i ) ( ushort i )const

    This is an overloaded function.

    See also toUShort().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( int i ) ( int i )const

    This is an overloaded function.

    See also toInt().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( uint i ) ( uint i )const

    This is an overloaded function.

    See also toUInt().

    Look up this member in the source code.

    Toggle details QString QLocale

    toStringtoString ( floati , charf='g' , int prec=6 ...) ( floati , charf='g' , int prec=6 )const

    This is an overloaded function.

    f and prec have the same meaning as in QString::number(double, char, int).

    See also toDouble().

    Look up this member in the source code.

    Toggle details QTime QLocale

    toTimetoTime ( const QString &string , FormatType format=LongFormat ...) ( const QString &string , FormatType format=LongFormat )const

    Parses the time string given in string and returns the time. The format of the time string is chosen according to the format parameter (see timeFormat()).

    If the time could not be parsed, returns an invalid time.

    See also timeFormat(), toDate(), toDateTime(), and QTime::fromString().

    Look up this member in the source code.

    Toggle details QTime QLocale

    toTimetoTime ( const QString &string , const QString &format ...) ( const QString &string , const QString &format )const

    Parses the time string given in string and returns the time. See QTime::fromString() for information on what is a valid format string.

    If the time could not be parsed, returns an invalid time.

    See also timeFormat(), toDate(), toDateTime(), and QTime::fromString().

    Look up this member in the source code.

    Toggle details uint QLocale

    toUInttoUInt ( const QString &s , bool *ok=0 , int base=0 ...) ( const QString &s , bool *ok=0 , int base=0 )const

    Returns the unsigned int represented by the localized string s, using base base. If 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 ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toInt() and toString().

    Look up this member in the source code.

    Toggle details qlonglong QLocale

    toULongLongtoULongLong ( const QString &s , bool *ok=0 , int base=0 ...) ( const QString &s , bool *ok=0 , int base=0 )const

    Returns the unsigned long long int represented by the localized string s, using base base. If 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 ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toLongLong(), toInt(), toDouble(), and toString().

    Look up this member in the source code.

    Toggle details ushort QLocale

    toUShorttoUShort ( const QString &s , bool *ok=0 , int base=0 ...) ( const QString &s , bool *ok=0 , int base=0 )const

    Returns the unsigned short int represented by the localized string s, using base base. If 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 ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.

    This function ignores leading and trailing whitespace.

    See also toShort() and toString().

    Look up this member in the source code.

    Toggle details QChar QLocale

    zeroDigitzeroDigit () ()const

    Returns the zero digit character of this locale.

    Look up this member in the source code.

    Toggle details bool QLocale

    operator!=operator!= ( const QLocale &other ) ( const QLocale &other )const

    Returns true if the QLocale object is not the same as the other locale specified; otherwise returns false.

    Look up this member in the source code.

    Toggle details QLocale & QLocale

    operator=operator= ( const QLocale &other ) ( const QLocale &other )

    Assigns other to this QLocale object and returns a reference to this QLocale object.

    Look up this member in the source code.

    Toggle details bool QLocale

    operator==operator== ( const QLocale &other ) ( const QLocale &other )const

    Returns true if the QLocale object is the same as the other locale specified; otherwise returns false.

    Look up this member in the source code.

      Notes provided by the Qt Community

      No notes