Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtCore.QLocale Class Reference

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

Inheritance diagram for QtCore.QLocale:
Collaboration diagram for QtCore.QLocale:

Public Types

enum  Country {
  Afghanistan = 1, Albania = 2, Algeria = 3, AmericanSamoa = 4,
  Andorra = 5, Angola = 6, Anguilla = 7, Antarctica = 8,
  AntiguaAndBarbuda = 9, AnyCountry = 0, 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,
  BritishVirginIslands = 233, 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, CookIslands = 51, CostaRica = 52,
  Croatia = 54, Cuba = 55, Cyprus = 56, CzechRepublic = 57,
  DemocraticRepublicOfCongo = 49, DemocraticRepublicOfKorea = 113, 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, 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, IvoryCoast = 53, Jamaica = 107,
  Japan = 108, Jordan = 109, Kazakhstan = 110, Kenya = 111,
  Kiribati = 112, Kuwait = 115, Kyrgyzstan = 116, Lao = 117,
  LastCountry = 246, LatinAmericaAndTheCaribbean = 246, 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, MetropolitanFrance = 75,
  Mexico = 139, Micronesia = 140, Moldova = 141, Monaco = 142,
  Mongolia = 143, Montenegro = 242, 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, PeoplesRepublicOfCongo = 50,
  Peru = 169, Philippines = 170, Pitcairn = 171, Poland = 172,
  Portugal = 173, PuertoRico = 174, Qatar = 175, RepublicOfKorea = 114,
  Reunion = 176, Romania = 177, RussianFederation = 178, Rwanda = 179,
  SaintBarthelemy = 244, SaintKittsAndNevis = 180, SaintMartin = 245, Samoa = 183,
  SanMarino = 184, SaoTomeAndPrincipe = 185, SaudiArabia = 186, Senegal = 187,
  Serbia = 243, SerbiaAndMontenegro = 241, Seychelles = 188, SierraLeone = 189,
  Singapore = 190, Slovakia = 191, Slovenia = 192, SolomonIslands = 193,
  Somalia = 194, SouthAfrica = 195, SouthGeorgiaAndTheSouthSandwichIslands = 196, Spain = 197,
  SriLanka = 198, StHelena = 199, StLucia = 181, StPierreAndMiquelon = 200,
  StVincentAndTheGrenadines = 182, 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, USVirginIslands = 234, Uganda = 221, Ukraine = 222,
  UnitedArabEmirates = 223, UnitedKingdom = 224, UnitedStates = 225, UnitedStatesMinorOutlyingIslands = 226,
  Uruguay = 227, Uzbekistan = 228, Vanuatu = 229, VaticanCityState = 230,
  Venezuela = 231, VietNam = 232, WallisAndFutunaIslands = 235, WesternSahara = 236,
  Yemen = 237, Yugoslavia = 238, Zambia = 239, Zimbabwe = 240
}
  More...
 
enum  CurrencySymbolFormat { CurrencyDisplayName = 2, CurrencyIsoCode = 0, CurrencySymbol = 1 }
  More...
 
enum  FormatType { LongFormat = 0, NarrowFormat = 2, ShortFormat = 1 }
  More...
 
enum  Language {
  Abkhazian = 2, Afan = 3, Afar = 4, Afrikaans = 5,
  Akan = 146, Albanian = 6, Amharic = 7, AnyLanguage = 0,
  Arabic = 8, Armenian = 9, Assamese = 10, Asu = 205,
  Atsam = 156, Aymara = 11, Azerbaijani = 12, Bambara = 188,
  Bashkir = 13, Basque = 14, Bemba = 195, Bena = 186,
  Bengali = 15, Bhutani = 16, Bihari = 17, Bislama = 18,
  Blin = 152, Bosnian = 142, Breton = 19, Bulgarian = 20,
  Burmese = 21, Byelorussian = 22, C = 1, Cambodian = 23,
  Catalan = 24, CentralMoroccoTamazight = 212, Cherokee = 190, Chewa = 165,
  Chiga = 211, Chinese = 25, Colognian = 201, Cornish = 145,
  Corsican = 26, Croatian = 27, Czech = 28, Danish = 29,
  Divehi = 143, Dutch = 30, Embu = 189, English = 31,
  Esperanto = 32, Estonian = 33, Ewe = 161, Faroese = 34,
  FijiLanguage = 35, Filipino = 166, Finnish = 36, French = 37,
  Frisian = 38, Friulian = 159, Fulah = 177, Ga = 148,
  Gaelic = 39, Galician = 40, Ganda = 194, Geez = 153,
  Georgian = 41, German = 42, Greek = 43, Greenlandic = 44,
  Guarani = 45, Gujarati = 46, Gusii = 175, Hausa = 47,
  Hawaiian = 163, Hebrew = 48, Hindi = 49, Hungarian = 50,
  Icelandic = 51, Igbo = 149, Indonesian = 52, Interlingua = 53,
  Interlingue = 54, Inuktitut = 55, Inupiak = 56, Irish = 57,
  Italian = 58, Japanese = 59, Javanese = 60, Jju = 158,
  Kabuverdianu = 196, Kabyle = 184, Kalenjin = 198, Kamba = 150,
  Kannada = 61, Kashmiri = 62, Kazakh = 63, Kikuyu = 178,
  Kinyarwanda = 64, Kirghiz = 65, Konkani = 147, Korean = 66,
  Koro = 154, KoyraChiini = 208, KoyraboroSenni = 213, Kpelle = 169,
  Kurdish = 67, Kurundi = 68, Langi = 193, Laothian = 69,
  LastLanguage = 214, Latin = 70, Latvian = 71, Lingala = 72,
  Lithuanian = 73, LowGerman = 170, Luo = 210, Luyia = 204,
  Macedonian = 74, Machame = 200, Makonde = 192, Malagasy = 75,
  Malay = 76, Malayalam = 77, Maltese = 78, Manx = 144,
  Maori = 79, Marathi = 80, Masai = 202, Meru = 197,
  Moldavian = 81, Mongolian = 82, Morisyen = 191, Nama = 199,
  NauruLanguage = 83, Nepali = 84, NorthNdebele = 181, NorthernSami = 173,
  NorthernSotho = 172, Norwegian = 85, NorwegianBokmal = 85, NorwegianNynorsk = 141,
  Nyankole = 185, Nynorsk = 141, Occitan = 86, Oriya = 87,
  Pashto = 88, Persian = 89, Polish = 90, Portuguese = 91,
  Punjabi = 92, Quechua = 93, RhaetoRomance = 94, Romanian = 95,
  Rombo = 182, Russian = 96, Rwa = 209, Saho = 207,
  Samburu = 179, Samoan = 97, Sangho = 98, Sanskrit = 99,
  Sena = 180, Serbian = 100, SerboCroatian = 101, Sesotho = 102,
  Setswana = 103, Shambala = 214, Shona = 104, SichuanYi = 168,
  Sidamo = 155, Sindhi = 105, Singhalese = 106, Siswati = 107,
  Slovak = 108, Slovenian = 109, Soga = 203, Somali = 110,
  SouthNdebele = 171, Spanish = 111, Sundanese = 112, Swahili = 113,
  Swedish = 114, SwissGerman = 167, Syriac = 151, Tachelhit = 183,
  Tagalog = 115, Taita = 176, Tajik = 116, Tamil = 117,
  Taroko = 174, Tatar = 118, Telugu = 119, Teso = 206,
  Thai = 120, Tibetan = 121, Tigre = 157, Tigrinya = 122,
  TongaLanguage = 123, Tsonga = 124, Turkish = 125, Turkmen = 126,
  Twi = 127, Tyap = 164, Uigur = 128, Ukrainian = 129,
  Urdu = 130, Uzbek = 131, Venda = 160, Vietnamese = 132,
  Volapuk = 133, Vunjo = 187, Walamo = 162, Welsh = 134,
  Wolof = 135, Xhosa = 136, Yiddish = 137, Yoruba = 138,
  Zhuang = 139, Zulu = 140
}
  More...
 
enum  MeasurementSystem { ImperialSystem = 1, MetricSystem = 0 }
  More...
 
enum  NumberOption { OmitGroupSeparator = 1, RejectGroupSeparator = 2 }
  More...
 
enum  QuotationStyle { AlternateQuotation = 1, StandardQuotation = 0 }
  More...
 
enum  Script {
  AnyScript = 0, ArabicScript = 1, CyrillicScript = 2, DeseretScript = 3,
  GurmukhiScript = 4, LastScript = 9, LatinScript = 7, MongolianScript = 8,
  SimplifiedChineseScript = 5, SimplifiedHanScript = 5, TifinaghScript = 9, TraditionalChineseScript = 6,
  TraditionalHanScript = 6
}
  More...
 

Public Member Functions

override bool Equals (object o)
 
override int GetHashCode ()
 
 QLocale ()
 
 
 QLocale (QLocale other)
 
 
 QLocale (string name)
 
 
 QLocale (QLocale.Language language, QLocale.Country country=QLocale.Country.AnyCountry)
 
 
 QLocale (QLocale.Language language, QLocale.Script script, QLocale.Country country)
 
 
virtual void CreateProxy ()
 
new string AmText ()
 
 
new string Bcp47Name ()
 
 
new QLocale.Country country ()
 
 
new string CreateSeparatedList (System.Collections.Generic.List< string > strl)
 
 
new string CurrencySymbol (QLocale.CurrencySymbolFormat arg1=QLocale.CurrencySymbolFormat.CurrencySymbol)
 
 
new string DateFormat (QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string DateTimeFormat (QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string DayName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new QChar DecimalPoint ()
 
 
new QChar Exponential ()
 
 
new Qt.DayOfWeek FirstDayOfWeek ()
 
 
new QChar GroupSeparator ()
 
 
new QLocale.Language language ()
 
 
new QLocale.MeasurementSystem measurementSystem ()
 
 
new string MonthName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string Name ()
 
 
new string NativeCountryName ()
 
 
new string NativeLanguageName ()
 
 
new QChar NegativeSign ()
 
 
new QChar Percent ()
 
 
new string PmText ()
 
 
new QChar PositiveSign ()
 
 
new string QuoteString (QStringRef str, QLocale.QuotationStyle style=QLocale.QuotationStyle.StandardQuotation)
 
 
new string QuoteString (string str, QLocale.QuotationStyle style=QLocale.QuotationStyle.StandardQuotation)
 
 
new QLocale.Script script ()
 
 
new string StandaloneDayName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string StandaloneMonthName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new Qt.LayoutDirection TextDirection ()
 
 
new string TimeFormat (QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string ToCurrencyString (long arg1, string symbol="")
 
 
new string ToCurrencyString (ulong arg1, string symbol="")
 
 
new string ToCurrencyString (short arg1, string symbol="")
 
 
new string ToCurrencyString (ushort arg1, string symbol="")
 
 
new string ToCurrencyString (int arg1, string symbol="")
 
 
new string ToCurrencyString (uint arg1, string symbol="")
 
 
new string ToCurrencyString (double arg1, string symbol="")
 
 
new string ToCurrencyString (float arg1, string symbol="")
 
 
new QDate ToDate (string @string, QLocale.FormatType arg2=QLocale.FormatType.LongFormat)
 
 
new QDate ToDate (string @string, string format)
 
 
new QDateTime ToDateTime (string @string, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new QDateTime ToDateTime (string @string, string format)
 
 
new double ToDouble (string s)
 
 
new double ToDouble (string s, ref bool ok)
 
 
new float ToFloat (string s)
 
 
new float ToFloat (string s, ref bool ok)
 
 
new int ToInt (string s)
 
 
new int ToInt (string s, ref bool ok, int @base=0)
 
 
new long ToLongLong (string s)
 
 
new long ToLongLong (string s, ref bool ok, int @base=0)
 
 
new string ToLower (string str)
 
 
new short ToShort (string s)
 
 
new short ToShort (string s, ref bool ok, int @base=0)
 
 
new string ToString (QDate date, string formatStr)
 
 
new string ToString (QDate date, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string ToString (QTime time, string formatStr)
 
 
new string ToString (QTime time, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string ToString (QDateTime dateTime, QLocale.FormatType format=QLocale.FormatType.LongFormat)
 
 
new string ToString (QDateTime dateTime, string format)
 
 
new string ToString (long i)
 
 
new string ToString (ulong i)
 
 
new string ToString (short i)
 
 
new string ToString (ushort i)
 
 
new string ToString (int i)
 
 
new string ToString (uint i)
 
 
new string ToString (double i)
 
 
new string ToString (float i)
 
 
new string ToString (double i, sbyte f, int prec=6)
 
 
new string ToString (float i, sbyte f, int prec=6)
 
 
new QTime ToTime (string @string, QLocale.FormatType arg2=QLocale.FormatType.LongFormat)
 
 
new QTime ToTime (string @string, string format)
 
 
new uint ToUInt (string s)
 
 
new uint ToUInt (string s, ref bool ok, int @base=0)
 
 
new long ToULongLong (string s)
 
 
new long ToULongLong (string s, ref bool ok, int @base=0)
 
 
new ushort ToUShort (string s)
 
 
new ushort ToUShort (string s, ref bool ok, int @base=0)
 
 
new string ToUpper (string str)
 
 
new
System.Collections.Generic.List
< string > 
UiLanguages ()
 
 
new
System.Collections.Generic.List
< Qt.DayOfWeek
Weekdays ()
 
 
new QChar ZeroDigit ()
 
 
new void Dispose ()
 

Static Public Member Functions

static QLocale C ()
 
 
static
System.Collections.Generic.List
< QLocale.Country
CountriesForLanguage (QLocale.Language lang)
 
 
static string CountryToString (QLocale.Country country)
 
 
static string LanguageToString (QLocale.Language language)
 
 
static
System.Collections.Generic.List
< QLocale
MatchingLocales (QLocale.Language language, QLocale.Script script, QLocale.Country country)
 
 
static bool operator!= (QLocale arg1, QLocale arg2)
 
 
static bool operator== (QLocale arg1, QLocale arg2)
 
 
static string ScriptToString (QLocale.Script script)
 
 
static void SetDefault (QLocale locale)
 
 
static QLocale System ()
 
 

Protected Member Functions

 QLocale (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QLocale.NumberOption NumberOptions [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
static new QMetaObject StaticMetaObject [get]
 

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:

QLocale egyptian(QLocale::Arabic, QLocale::Egypt);

QString s1 = egyptian.toString(1.571429E+07, 'e');

QString s2 = egyptian.toString(10);

double d = egyptian.toDouble(s1);

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:

QLocale::setDefault(QLocale(QLocale::Hebrew, QLocale::Israel));

QLocale hebrew; // Constructs a default QLocale

QString s1 = hebrew.toString(15714.3, 'e');

bool ok;

double d;

QLocale::setDefault(QLocale::C);

d = QString("1234,56").toDouble(&ok); // ok == false

d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56

QLocale::setDefault(QLocale::German);

d = QString("1234,56").toDouble(&ok); // ok == true, d == 1234.56

d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56

QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));

str = QString("%1 L2 L3")

.arg(12345).arg(12345).arg(12345, 0, 16);

// 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.

QLocale korean("ko");

QLocale swiss("de_CH");

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

Note: For the current keyboard input locale take a look at QApplication::keyboardInputLocale().

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(), QString::toDouble(), and QApplication::keyboardInputLocale().

Member Enumeration Documentation

This enumerated type is used to specify a country.

See also country() and countryToString().

Enumerator:
Afghanistan 
Albania 
Algeria 
AmericanSamoa 
Andorra 
Angola 
Anguilla 
Antarctica 
AntiguaAndBarbuda 
AnyCountry 
Argentina 
Armenia 
Aruba 
Australia 
Austria 
Azerbaijan 
Bahamas 
Bahrain 
Bangladesh 
Barbados 
Belarus 
Belgium 
Belize 
Benin 
Bermuda 
Bhutan 
Bolivia 
BosniaAndHerzegowina 
Botswana 
BouvetIsland 
Brazil 
BritishIndianOceanTerritory 
BritishVirginIslands 
BruneiDarussalam 
Bulgaria 
BurkinaFaso 
Burundi 
Cambodia 
Cameroon 
Canada 
CapeVerde 
CaymanIslands 
CentralAfricanRepublic 
Chad 
Chile 
China 
ChristmasIsland 
CocosIslands 
Colombia 
Comoros 
CookIslands 
CostaRica 
Croatia 
Cuba 
Cyprus 
CzechRepublic 
DemocraticRepublicOfCongo 
DemocraticRepublicOfKorea 
Denmark 
Djibouti 
Dominica 
DominicanRepublic 
EastTimor 
Ecuador 
Egypt 
ElSalvador 
EquatorialGuinea 
Eritrea 
Estonia 
Ethiopia 
FalklandIslands 
FaroeIslands 
FijiCountry 
Finland 
France 
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 
IvoryCoast 
Jamaica 
Japan 
Jordan 
Kazakhstan 
Kenya 
Kiribati 
Kuwait 
Kyrgyzstan 
Lao 
LastCountry 
LatinAmericaAndTheCaribbean 
Latvia 
Lebanon 
Lesotho 
Liberia 
LibyanArabJamahiriya 
Liechtenstein 
Lithuania 
Luxembourg 
Macau 
Macedonia 
Madagascar 
Malawi 
Malaysia 
Maldives 
Mali 
Malta 
MarshallIslands 
Martinique 
Mauritania 
Mauritius 
Mayotte 
MetropolitanFrance 
Mexico 
Micronesia 
Moldova 
Monaco 
Mongolia 
Montenegro 
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 
PeoplesRepublicOfCongo 
Peru 
Philippines 
Pitcairn 
Poland 
Portugal 
PuertoRico 
Qatar 
RepublicOfKorea 
Reunion 
Romania 
RussianFederation 
Rwanda 
SaintBarthelemy 
SaintKittsAndNevis 
SaintMartin 
Samoa 
SanMarino 
SaoTomeAndPrincipe 
SaudiArabia 
Senegal 
Serbia 
SerbiaAndMontenegro 
Seychelles 
SierraLeone 
Singapore 
Slovakia 
Slovenia 
SolomonIslands 
Somalia 
SouthAfrica 
SouthGeorgiaAndTheSouthSandwichIslands 
Spain 
SriLanka 
StHelena 
StLucia 
StPierreAndMiquelon 
StVincentAndTheGrenadines 
Sudan 
Suriname 
SvalbardAndJanMayenIslands 
Swaziland 
Sweden 
Switzerland 
SyrianArabRepublic 
Taiwan 
Tajikistan 
Tanzania 
Thailand 
Togo 
Tokelau 
TongaCountry 
TrinidadAndTobago 
Tunisia 
Turkey 
Turkmenistan 
TurksAndCaicosIslands 
Tuvalu 
USVirginIslands 
Uganda 
Ukraine 
UnitedArabEmirates 
UnitedKingdom 
UnitedStates 
UnitedStatesMinorOutlyingIslands 
Uruguay 
Uzbekistan 
Vanuatu 
VaticanCityState 
Venezuela 
VietNam 
WallisAndFutunaIslands 
WesternSahara 
Yemen 
Yugoslavia 
Zambia 
Zimbabwe 

Specifies the format of the currency symbol.

This enum was introduced or modified in Qt 4.8.

Enumerator:
CurrencyDisplayName 

A user readable name of the currency.

CurrencyIsoCode 

A ISO-4217 code of the currency.

CurrencySymbol 

A currency symbol.

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

Enumerator:
LongFormat 

The long version of day and month names; for example, returning "January" as a month name.

NarrowFormat 

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.

ShortFormat 

The short version of day and month names; for example, returning "Jan" as a month name.

This enumerated type is used to specify a language.

See also language() and languageToString().

Enumerator:
Abkhazian 
Afan 
Afar 
Afrikaans 
Akan 
Albanian 
Amharic 
AnyLanguage 
Arabic 
Armenian 
Assamese 
Asu 
Atsam 
Aymara 
Azerbaijani 
Bambara 
Bashkir 
Basque 
Bemba 
Bena 
Bengali 
Bhutani 
Bihari 
Bislama 
Blin 
Bosnian 
Breton 
Bulgarian 
Burmese 
Byelorussian 
C 

The "C" locale is identical in behavior to English/UnitedStates.

Cambodian 
Catalan 
CentralMoroccoTamazight 
Cherokee 
Chewa 
Chiga 
Chinese 
Colognian 
Cornish 
Corsican 
Croatian 
Czech 
Danish 
Divehi 
Dutch 
Embu 
English 
Esperanto 
Estonian 
Ewe 
Faroese 
FijiLanguage 
Filipino 
Finnish 
French 
Frisian 
Friulian 
Fulah 
Ga 
Gaelic 
Galician 
Ganda 
Geez 
Georgian 
German 
Greek 
Greenlandic 
Guarani 
Gujarati 
Gusii 
Hausa 
Hawaiian 
Hebrew 
Hindi 
Hungarian 
Icelandic 
Igbo 
Indonesian 
Interlingua 
Interlingue 
Inuktitut 
Inupiak 
Irish 
Italian 
Japanese 
Javanese 
Jju 
Kabuverdianu 
Kabyle 
Kalenjin 
Kamba 
Kannada 
Kashmiri 
Kazakh 
Kikuyu 
Kinyarwanda 
Kirghiz 
Konkani 
Korean 
Koro 
KoyraChiini 
KoyraboroSenni 
Kpelle 
Kurdish 
Kurundi 
Langi 
Laothian 
LastLanguage 
Latin 
Latvian 
Lingala 
Lithuanian 
LowGerman 
Luo 
Luyia 
Macedonian 
Machame 
Makonde 
Malagasy 
Malay 
Malayalam 
Maltese 
Manx 
Maori 
Marathi 
Masai 
Meru 
Moldavian 
Mongolian 
Morisyen 
Nama 
NauruLanguage 
Nepali 
NorthNdebele 
NorthernSami 
NorthernSotho 
Norwegian 
NorwegianBokmal 
NorwegianNynorsk 
Nyankole 
Nynorsk 

Obsolete, please use NorwegianNynorsk

Occitan 
Oriya 
Pashto 
Persian 
Polish 
Portuguese 
Punjabi 
Quechua 
RhaetoRomance 
Romanian 
Rombo 
Russian 
Rwa 
Saho 
Samburu 
Samoan 
Sangho 
Sanskrit 
Sena 
Serbian 
SerboCroatian 
Sesotho 
Setswana 
Shambala 
Shona 
SichuanYi 
Sidamo 
Sindhi 
Singhalese 
Siswati 
Slovak 
Slovenian 
Soga 
Somali 
SouthNdebele 
Spanish 
Sundanese 
Swahili 
Swedish 
SwissGerman 
Syriac 
Tachelhit 
Tagalog 
Taita 
Tajik 
Tamil 
Taroko 
Tatar 
Telugu 
Teso 
Thai 
Tibetan 
Tigre 
Tigrinya 
TongaLanguage 
Tsonga 
Turkish 
Turkmen 
Twi 
Tyap 
Uigur 
Ukrainian 
Urdu 
Uzbek 
Venda 
Vietnamese 
Volapuk 
Vunjo 
Walamo 
Welsh 
Wolof 
Xhosa 
Yiddish 
Yoruba 
Zhuang 
Zulu 

This enum defines which units are used for measurement.

This enum was introduced or modified in Qt 4.4.

Enumerator:
ImperialSystem 

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.

MetricSystem 

This value indicates metric units, such as meters, centimeters and millimeters.

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

See also setNumberOptions() and numberOptions().

Enumerator:
OmitGroupSeparator 

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.

RejectGroupSeparator 

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.

This enum defines a set of possible styles for locale specific quotation.

This enum was introduced or modified in Qt 4.8.

See also quoteString().

Enumerator:
AlternateQuotation 

If this option is set, the alternate quotation marks will be used to quote strings.

StandardQuotation 

If this option is set, the standard quotation marks will be used to quote strings.

This enumerated type is used to specify a script.

This enum was introduced or modified in Qt 4.8.

See also script(), scriptToString(), and languageToString().

Enumerator:
AnyScript 
ArabicScript 
CyrillicScript 
DeseretScript 
GurmukhiScript 
LastScript 
LatinScript 
MongolianScript 
SimplifiedChineseScript 

Same as SimplifiedHanScript

SimplifiedHanScript 

Same as SimplifiedChineseScript

TifinaghScript 
TraditionalChineseScript 

Same as TraditionalHanScript

TraditionalHanScript 

Same as TraditionalChineseScript

Constructor & Destructor Documentation

QtCore.QLocale.QLocale ( System.Type  dummy)
protected
QtCore.QLocale.QLocale ( )

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

QtCore.QLocale.QLocale ( QLocale  other)

Constructs a QLocale object as a copy of other.

QtCore.QLocale.QLocale ( string  name)

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

language is a lowercase, two-letter, ISO 639 language code,

script is a titlecase, four-letter, ISO 15924 script code,

country is an uppercase, two- or three-letter, ISO 3166 country code (also "419" as defined by United Nations),

and codeset and modifier are ignored.

The separator can be either underscore or a minus sign.

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, script and country codes are converted to their respective Language, Script and Country enums. After this conversion is performed the constructor behaves exactly like QLocale(Country, Script, Language).

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

See also bcp47Name().

QtCore.QLocale.QLocale ( QLocale.Language  language,
QLocale.Country  country = QLocale.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().

QtCore.QLocale.QLocale ( QLocale.Language  language,
QLocale.Script  script,
QLocale.Country  country 
)

Constructs a QLocale object with the specified language, script and country.

If the language/script/country is found in the database, it is used.

If both script is AnyScript and country is AnyCountry, the language is used with the most appropriate available script and country (for example, Germany for German),

If either script is AnyScript or country is AnyCountry, the language is used with the first locale that matches the given script and country.

If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault()).

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

This function was introduced in Qt 4.8.

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

Member Function Documentation

new string QtCore.QLocale.AmText ( )

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

This function was introduced in Qt 4.5.

See also pmText().

new string QtCore.QLocale.Bcp47Name ( )

Returns the dash-separated language, script and country (and possibly other BCP47 fields) of this locale as a string.

Unlike the uiLanguages() the returned value of the bcp47Name() represents the locale name of the QLocale data but not the language the user-interface should be in.

This function tries to conform the locale name to BCP47.

This function was introduced in Qt 4.8.

See also language(), country(), script(), and uiLanguages().

static QLocale QtCore.QLocale.C ( )
static

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

See also system().

static System.Collections.Generic.List<QLocale.Country> QtCore.QLocale.CountriesForLanguage ( QLocale.Language  lang)
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.

This function was introduced in Qt 4.3.

See also matchingLocales().

new QLocale.Country QtCore.QLocale.country ( )

Returns the country of this locale.

See also language(), script(), countryToString(), and bcp47Name().

static string QtCore.QLocale.CountryToString ( QLocale.Country  country)
static

Returns a QString containing the name of country.

See also languageToString(), scriptToString(), country(), and bcp47Name().

virtual void QtCore.QLocale.CreateProxy ( )
virtual
new string QtCore.QLocale.CreateSeparatedList ( System.Collections.Generic.List< string >  strl)

Returns a string that represents a join of a given list of strings with a separator defined by the locale.

This function was introduced in Qt 4.8.

new string QtCore.QLocale.CurrencySymbol ( QLocale.CurrencySymbolFormat  arg1 = QLocale.CurrencySymbolFormat.CurrencySymbol)

Returns a currency symbol according to the format.

This function was introduced in Qt 4.8.

new string QtCore.QLocale.DateFormat ( QLocale.FormatType  format = QLocale.FormatType.LongFormat)

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.

This function was introduced in Qt 4.1.

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

new string QtCore.QLocale.DateTimeFormat ( QLocale.FormatType  format = QLocale.FormatType.LongFormat)

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.

This function was introduced in Qt 4.4.

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

new string QtCore.QLocale.DayName ( int  arg1,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

This function was introduced in Qt 4.2.

See also monthName() and standaloneDayName().

new QChar QtCore.QLocale.DecimalPoint ( )

Returns the decimal point character of this locale.

This function was introduced in Qt 4.1.

new void QtCore.QLocale.Dispose ( )
override bool QtCore.QLocale.Equals ( object  o)
new QChar QtCore.QLocale.Exponential ( )

Returns the exponential character of this locale.

This function was introduced in Qt 4.1.

new Qt.DayOfWeek QtCore.QLocale.FirstDayOfWeek ( )

Returns the first day of the week according to the current locale.

This function was introduced in Qt 4.8.

override int QtCore.QLocale.GetHashCode ( )
new QChar QtCore.QLocale.GroupSeparator ( )

Returns the group separator character of this locale.

This function was introduced in Qt 4.1.

new QLocale.Language QtCore.QLocale.language ( )

Returns the language of this locale.

See also script(), country(), languageToString(), and bcp47Name().

static string QtCore.QLocale.LanguageToString ( QLocale.Language  language)
static

Returns a QString containing the name of language.

See also countryToString(), scriptToString(), and bcp47Name().

static System.Collections.Generic.List<QLocale> QtCore.QLocale.MatchingLocales ( QLocale.Language  language,
QLocale.Script  script,
QLocale.Country  country 
)
static

Returns a list of valid locale objects that match the given language, script and country.

Getting a list of all locales: QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);

This function was introduced in Qt 4.8.

new QLocale.MeasurementSystem QtCore.QLocale.measurementSystem ( )

Returns the measurement system for the locale.

This function was introduced in Qt 4.4.

new string QtCore.QLocale.MonthName ( int  arg1,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

This function was introduced in Qt 4.2.

See also dayName() and standaloneMonthName().

new string QtCore.QLocale.Name ( )

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- or three-letter ISO 3166 country code.

Note that even if QLocale object was constructed with an explicit script, name() will not contain it for compatibility reasons. Use bcp47Name() instead if you need a full locale name.

See also QLocale(), language(), script(), country(), and bcp47Name().

new string QtCore.QLocale.NativeCountryName ( )

Returns a native name of the country for the locale. For example "Espa&#241;a" for Spanish/Spain locale.

This function was introduced in Qt 4.8.

See also nativeLanguageName() and countryToString().

new string QtCore.QLocale.NativeLanguageName ( )

Returns a native name of the language for the locale. For example "Schwiizert&#252;&#252;tsch" for Swiss-German locale.

This function was introduced in Qt 4.8.

See also nativeCountryName() and languageToString().

new QChar QtCore.QLocale.NegativeSign ( )

Returns the negative sign character of this locale.

This function was introduced in Qt 4.1.

static bool QtCore.QLocale.operator!= ( QLocale  arg1,
QLocale  arg2 
)
static

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

static bool QtCore.QLocale.operator== ( QLocale  arg1,
QLocale  arg2 
)
static

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

new QChar QtCore.QLocale.Percent ( )

Returns the percent character of this locale.

This function was introduced in Qt 4.1.

new string QtCore.QLocale.PmText ( )

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

This function was introduced in Qt 4.5.

See also amText().

new QChar QtCore.QLocale.PositiveSign ( )

Returns the positive sign character of this locale.

This function was introduced in Qt 4.5.

new string QtCore.QLocale.QuoteString ( QStringRef  str,
QLocale.QuotationStyle  style = QLocale.QuotationStyle.StandardQuotation 
)

This is an overloaded function.

This function was introduced in Qt 4.8.

new string QtCore.QLocale.QuoteString ( string  str,
QLocale.QuotationStyle  style = QLocale.QuotationStyle.StandardQuotation 
)

Returns str quoted according to the current locale using the given quotation style.

This function was introduced in Qt 4.8.

new QLocale.Script QtCore.QLocale.script ( )

Returns the script of this locale.

This function was introduced in Qt 4.8.

See also language(), country(), languageToString(), scriptToString(), and bcp47Name().

static string QtCore.QLocale.ScriptToString ( QLocale.Script  script)
static

Returns a QString containing the name of script.

This function was introduced in Qt 4.8.

See also languageToString(), countryToString(), script(), and bcp47Name().

static void QtCore.QLocale.SetDefault ( 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.

Warning: This function is not reentrant.

See also system() and c().

new string QtCore.QLocale.StandaloneDayName ( int  arg1,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

This function was introduced in Qt 4.5.

See also dayName() and standaloneMonthName().

new string QtCore.QLocale.StandaloneMonthName ( int  arg1,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

This function was introduced in Qt 4.5.

See also monthName() and standaloneDayName().

static QLocale QtCore.QLocale.System ( )
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().

new Qt.LayoutDirection QtCore.QLocale.TextDirection ( )

Returns the text direction of the language.

This function was introduced in Qt 4.7.

new string QtCore.QLocale.TimeFormat ( QLocale.FormatType  format = QLocale.FormatType.LongFormat)

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.

This function was introduced in Qt 4.1.

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

new string QtCore.QLocale.ToCurrencyString ( long  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( ulong  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( short  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( ushort  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( int  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( uint  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( double  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new string QtCore.QLocale.ToCurrencyString ( float  arg1,
string  symbol = "" 
)

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

This function was introduced in Qt 4.8.

See also currencySymbol().

new QDate QtCore.QLocale.ToDate ( string @  string,
QLocale.FormatType  arg2 = QLocale.FormatType.LongFormat 
)

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.

This function was introduced in Qt 4.4.

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

new QDate QtCore.QLocale.ToDate ( string @  string,
string  format 
)

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.

This function was introduced in Qt 4.4.

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

new QDateTime QtCore.QLocale.ToDateTime ( string @  string,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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.

This function was introduced in Qt 4.4.

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

new QDateTime QtCore.QLocale.ToDateTime ( string @  string,
string  format 
)

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.

This function was introduced in Qt 4.4.

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

new double QtCore.QLocale.ToDouble ( string  s)

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.

bool ok;

double d;

QLocale c(QLocale::C);

d = c.toDouble( "1234.56", &ok ); // ok == true, d == 1234.56

d = c.toDouble( "1,234.56", &ok ); // ok == true, d == 1234.56

d = c.toDouble( "1234,56", &ok ); // ok == false

QLocale german(QLocale::German);

d = german.toDouble( "1234,56", &ok ); // ok == true, d == 1234.56

d = german.toDouble( "1.234,56", &ok ); // ok == true, d == 1234.56

d = german.toDouble( "1234.56", &ok ); // ok == false

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

new double QtCore.QLocale.ToDouble ( string  s,
ref bool  ok 
)

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.

bool ok;

double d;

QLocale c(QLocale::C);

d = c.toDouble( "1234.56", &ok ); // ok == true, d == 1234.56

d = c.toDouble( "1,234.56", &ok ); // ok == true, d == 1234.56

d = c.toDouble( "1234,56", &ok ); // ok == false

QLocale german(QLocale::German);

d = german.toDouble( "1234,56", &ok ); // ok == true, d == 1234.56

d = german.toDouble( "1.234,56", &ok ); // ok == true, d == 1234.56

d = german.toDouble( "1234.56", &ok ); // ok == false

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

new float QtCore.QLocale.ToFloat ( string  s)

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

new float QtCore.QLocale.ToFloat ( string  s,
ref bool  ok 
)

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

new int QtCore.QLocale.ToInt ( string  s)

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

new int QtCore.QLocale.ToInt ( string  s,
ref bool  ok,
int @  base = 0 
)

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

new long QtCore.QLocale.ToLongLong ( string  s)

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

new long QtCore.QLocale.ToLongLong ( string  s,
ref bool  ok,
int @  base = 0 
)

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

new string QtCore.QLocale.ToLower ( string  str)

Returns a lowercase copy of str.

This function was introduced in Qt 4.8.

new short QtCore.QLocale.ToShort ( string  s)

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

new short QtCore.QLocale.ToShort ( string  s,
ref bool  ok,
int @  base = 0 
)

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

new string QtCore.QLocale.ToString ( QDate  date,
string  formatStr 
)

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

new string QtCore.QLocale.ToString ( QDate  date,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

new string QtCore.QLocale.ToString ( QTime  time,
string  formatStr 
)

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.

new string QtCore.QLocale.ToString ( QTime  time,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

new string QtCore.QLocale.ToString ( QDateTime  dateTime,
QLocale.FormatType  format = QLocale.FormatType.LongFormat 
)

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

This function was introduced in Qt 4.4.

new string QtCore.QLocale.ToString ( QDateTime  dateTime,
string  format 
)

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.

This function was introduced in Qt 4.4.

new string QtCore.QLocale.ToString ( long  i)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( ulong  i)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( short  i)

This is an overloaded function.

See also toShort().

new string QtCore.QLocale.ToString ( ushort  i)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( int  i)

This is an overloaded function.

See also toInt().

new string QtCore.QLocale.ToString ( uint  i)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( double  i)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( float  i)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( double  i,
sbyte  f,
int  prec = 6 
)

Returns a localized string representation of i.

See also toLongLong().

new string QtCore.QLocale.ToString ( float  i,
sbyte  f,
int  prec = 6 
)

Returns a localized string representation of i.

See also toLongLong().

new QTime QtCore.QLocale.ToTime ( string @  string,
QLocale.FormatType  arg2 = QLocale.FormatType.LongFormat 
)

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.

This function was introduced in Qt 4.4.

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

new QTime QtCore.QLocale.ToTime ( string @  string,
string  format 
)

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.

This function was introduced in Qt 4.4.

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

new uint QtCore.QLocale.ToUInt ( string  s)

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

new uint QtCore.QLocale.ToUInt ( string  s,
ref bool  ok,
int @  base = 0 
)

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

new long QtCore.QLocale.ToULongLong ( string  s)

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

new long QtCore.QLocale.ToULongLong ( string  s,
ref bool  ok,
int @  base = 0 
)

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

new string QtCore.QLocale.ToUpper ( string  str)

Returns an uppercase copy of str.

This function was introduced in Qt 4.8.

new ushort QtCore.QLocale.ToUShort ( string  s)

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

new ushort QtCore.QLocale.ToUShort ( string  s,
ref bool  ok,
int @  base = 0 
)

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

new System.Collections.Generic.List<string> QtCore.QLocale.UiLanguages ( )

Returns an ordered list of locale names for translation purposes in preference order.

The return value represents locale names that the user expects to see the UI translation in.

Most like you do not need to use this function directly, but just pass the QLocale object to the QTranslator::load() function.

The first item in the list is the most preferred one.

This function was introduced in Qt 4.8.

See also QTranslator and bcp47Name().

new System.Collections.Generic.List<Qt.DayOfWeek> QtCore.QLocale.Weekdays ( )

Returns a list of days that are considered weekdays according to the current locale.

This function was introduced in Qt 4.8.

new QChar QtCore.QLocale.ZeroDigit ( )

Returns the zero digit character of this locale.

This function was introduced in Qt 4.1.

Member Data Documentation

SmokeInvocation QtCore.QLocale.interceptor
protected

Property Documentation

new QLocale.NumberOption QtCore.QLocale.NumberOptions
getset

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

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

This function was introduced in Qt 4.2.

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

This function was introduced in Qt 4.2.

virtual System.IntPtr QtCore.QLocale.SmokeObject
getset
new QMetaObject QtCore.QLocale.StaticMetaObject
staticget