IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QLocale Class

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QLocale Class▲

  • Header: QLocale

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Core)

    target_link_libraries(mytarget PRIVATE Qt6::Core)

  • qmake: QT += core

  • Group: QLocale is part of i18n, string-processing, https://

Detailed Description▲

https:// is constructed for a specified language, optional script and territory. It offers various facilities for formatting data as text, localized appropriately, and for reading data out of localized text.

Example:

 
Sélectionnez
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);

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

  • If a https:// object is constructed with the default constructor, it will use the default locale's settings.

  • https://() 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 https:// directly:

 
Sélectionnez
bool ok;
double d;

QLocale::setDefault(QLocale::C);      // uses '.' as a decimal point
QLocale cLocale;                      // default-constructed C locale
d = cLocale.toDouble("1234,56", &ok); // ok == false, d == 0
d = cLocale.toDouble("1234.56", &ok); // ok == true,  d == 1234.56

QLocale::setDefault(QLocale::German); // uses ',' as a decimal point
QLocale german;                       // default-constructed German locale
d = german.toDouble("1234,56", &ok);  // ok == true,  d == 1234.56
d = german.toDouble("1234.56", &ok);  // ok == false, d == 0

QLocale::setDefault(QLocale::English);
// Default locale now uses ',' as a group separator.
QString str = QString("%1 %L2 %L3").arg(12345).arg(12345).arg(12345, 0, 16);
// str == "12345 12,345 3039"

An alternative method for constructing a https:// object is by specifying the locale name.

 
Sélectionnez
QLocale korean("ko");
QLocale swiss("de_CH");

This constructor reads the language, script and/or territory from the given name, accepting either uderscore or dash as separator (and ignoring any trailing .codeset or @variant suffix).

For the current keyboard input locale take a look at QInputMethod::locale().

https://'s data is based on Common Locale Data Repository v40.

Matching combinations of language, script and territory▲

https:// has data, derived from CLDR, for many combinations of language, script and territory, but not all. If it is constructed with all three of these key values specified (treating AnyLanguage, AnyScript or AnyTerritory as unspecified) and https:// has data for the given combination, this data is used. Otherwise, https:// does its best to find a sensible combination of language, script and territory, for which it does have data, that matches those that were specified.

The CLDR provides tables of likely combinations, which are used to fill in any unspecified key or keys; if https:// has data for the result of such a likely combination, that is used. If no language is specified, and none can be determined from script and territory, or if https:// has no data for the language, the "C" locale (when reading the keys from a string) or default locale (otherwise) is used.

When https:// has no data for the keys specified, with likely keys filled in where unspecified, but does have data for the resulting language, a fall-back is sought, based on ignoring either territory, script or both (in that order). This results in a https:// which may not match what was asked for, but provides localization that's as suitable as the available data permits, for the keys specified.

Use https://(), https://() and https://() to determine the actual keys used.

See Also▲

See also https://(), QInputMethod::locale()

Member Type Documentation▲

 

enum QLocale::Country▲

This enumerated type is used to identify a territory.

An individual territory may be a province of a country, a country (by far the most common case) or a larger geographic entity, to which some localization details are specific.

Constant

Value

Description

https://::AnyCountry

AnyTerritory

Osbolete alias for AnyTerritory

https://::AnyTerritory

0

Since 6.2

https://::Afghanistan

1

 

https://::AlandIslands

2

 

https://::Albania

3

 

https://::Algeria

4

 

https://::AmericanSamoa

5

 

https://::Andorra

6

 

https://::Angola

7

 

https://::Anguilla

8

 

https://::Antarctica

9

 

https://::AntiguaAndBarbuda

10

 

https://::Argentina

11

 

https://::Armenia

12

 

https://::Aruba

13

 

https://::AscensionIsland

14

 

https://::Australia

15

 

https://::Austria

16

 

https://::Azerbaijan

17

 

https://::Bahamas

18

 

https://::Bahrain

19

 

https://::Bangladesh

20

 

https://::Barbados

21

 

https://::Belarus

22

 

https://::Belgium

23

 

https://::Belize

24

 

https://::Benin

25

 

https://::Bermuda

26

 

https://::Bhutan

27

 

https://::Bolivia

28

 

https://::Bonaire

CaribbeanNetherlands

 

https://::BosniaAndHerzegowina

BosniaAndHerzegovina

Obsolete, use BosniaAndHerzegovina instead

https://::BosniaAndHerzegovina

29

Since 6.0

https://::Botswana

30

 

https://::BouvetIsland

31

 

https://::Brazil

32

 

https://::BritishIndianOceanTerritory

33

 

https://::BritishVirginIslands

34

 

https://::Brunei

35

 

https://::Bulgaria

36

 

https://::BurkinaFaso

37

 

https://::Burundi

38

 

https://::Cambodia

39

 

https://::Cameroon

40

 

https://::Canada

41

 

https://::CanaryIslands

42

 

https://::CaribbeanNetherlands

44

 

https://::CapeVerde

43

 

https://::CaymanIslands

45

 

https://::CentralAfricanRepublic

46

 

https://::CeutaAndMelilla

47

 

https://::Chad

48

 

https://::Chile

49

 

https://::China

50

 

https://::ChristmasIsland

51

 

https://::ClippertonIsland

52

 

https://::CocosIslands

53

 

https://::Colombia

54

 

https://::Comoros

55

 

https://::CongoBrazzaville

56

 

https://::CongoKinshasa

57

 

https://::CookIslands

58

 

https://::CostaRica

59

 

https://::Croatia

60

 

https://::Cuba

61

 

https://::Curacao

62

Since Qt 6.0

https://::CuraSao

Curacao

Obsolete, use Curacao instead

https://::Cyprus

63

 

https://::Czechia

64

Since 6.0

https://::CzechRepublic

Czechia

Obsolete, use Czechia instead

https://::DemocraticRepublicOfCongo

CongoKinshasa

Obsolete, use CongoKinshasa instead

https://::DemocraticRepublicOfKorea

NorthKorea

Obsolete, use NorthKorea instead

https://::Denmark

65

 

https://::DiegoGarcia

66

 

https://::Djibouti

67

 

https://::Dominica

68

 

https://::DominicanRepublic

69

 

https://::EastTimor

TimorLeste

 

https://::Ecuador

70

 

https://::Egypt

71

 

https://::ElSalvador

72

 

https://::EquatorialGuinea

73

 

https://::Eritrea

74

 

https://::Estonia

75

 

https://::Eswatini

76

 

https://::Ethiopia

77

 

https://::EuropeanUnion

79

Since Qt 5.7

https://::Europe

78

Since Qt 5.12

https://::FalklandIslands

80

 

https://::FaroeIslands

81

 

https://::Fiji

82

 

https://::Finland

83

 

https://::France

84

 

https://::FrenchGuiana

85

 

https://::FrenchPolynesia

86

 

https://::FrenchSouthernTerritories

87

 

https://::Gabon

88

 

https://::Gambia

89

 

https://::Georgia

90

 

https://::Germany

91

 

https://::Ghana

92

 

https://::Gibraltar

93

 

https://::Greece

94

 

https://::Greenland

95

 

https://::Grenada

96

 

https://::Guadeloupe

97

 

https://::Guam

98

 

https://::Guatemala

99

 

https://::Guernsey

100

 

https://::Guinea

102

 

https://::GuineaBissau

101

 

https://::Guyana

103

 

https://::Haiti

104

 

https://::HeardAndMcDonaldIslands

105

 

https://::Honduras

106

 

https://::HongKong

107

 

https://::Hungary

108

 

https://::Iceland

109

 

https://::India

110

 

https://::Indonesia

111

 

https://::Iran

112

 

https://::Iraq

113

 

https://::Ireland

114

 

https://::IsleOfMan

115

 

https://::Israel

116

 

https://::Italy

117

 

https://::IvoryCoast

118

 

https://::Jamaica

119

 

https://::Japan

120

 

https://::Jersey

121

 

https://::Jordan

122

 

https://::Kazakhstan

123

 

https://::Kenya

124

 

https://::Kiribati

125

 

https://::Kosovo

126

Since Qt 5.2

https://::Kuwait

127

 

https://::Kyrgyzstan

128

 

https://::Laos

129

 

https://::LatinAmerica

130

 

https://::LatinAmericaAndTheCaribbean

LatinAmerica

Obsolete, use LatinAmerica instead

https://::Latvia

131

 

https://::Lebanon

132

 

https://::Lesotho

133

 

https://::Liberia

134

 

https://::Libya

135

 

https://::Liechtenstein

136

 

https://::Lithuania

137

 

https://::Luxembourg

138

 

https://::Macao

139

 

https://::Macau

Macao

 

https://::Macedonia

140

 

https://::Madagascar

141

 

https://::Malawi

142

 

https://::Malaysia

143

 

https://::Maldives

144

 

https://::Mali

145

 

https://::Malta

146

 

https://::MarshallIslands

147

 

https://::Martinique

148

 

https://::Mauritania

149

 

https://::Mauritius

150

 

https://::Mayotte

151

 

https://::Mexico

152

 

https://::Micronesia

153

 

https://::Moldova

154

 

https://::Monaco

155

 

https://::Mongolia

156

 

https://::Montenegro

157

 

https://::Montserrat

158

 

https://::Morocco

159

 

https://::Mozambique

160

 

https://::Myanmar

161

 

https://::Namibia

162

 

https://::NauruCountry

NauruTerritory

Osbolete alias for NauruTerritory

https://::NauruTerritory

163

Since 6.2

https://::Nepal

164

 

https://::Netherlands

165

 

https://::NewCaledonia

166

 

https://::NewZealand

167

 

https://::Nicaragua

168

 

https://::Niger

170

 

https://::Nigeria

169

 

https://::Niue

171

 

https://::NorfolkIsland

172

 

https://::NorthernMarianaIslands

173

 

https://::NorthKorea

174

 

https://::Norway

175

 

https://::Oman

176

 

https://::OutlyingOceania

177

Since Qt 5.7

https://::Pakistan

178

 

https://::Palau

179

 

https://::PalestinianTerritories

180

 

https://::Panama

181

 

https://::PapuaNewGuinea

182

 

https://::Paraguay

183

 

https://::PeoplesRepublicOfCongo

CongoBrazzaville

Obsolete, use CongoBrazzaville instead

https://::Peru

184

 

https://::Philippines

185

 

https://::Pitcairn

186

 

https://::Poland

187

 

https://::Portugal

188

 

https://::PuertoRico

189

 

https://::Qatar

190

 

https://::RepublicOfKorea

SouthKorea

Obsolete, use SouthKorea instead

https://::Reunion

191

 

https://::Romania

192

 

https://::RussianFederation

Russia

 

https://::Russia

193

 

https://::Rwanda

194

 

https://::SaintBarthelemy

195

 

https://::SaintHelena

196

 

https://::SaintKittsAndNevis

197

 

https://::SaintLucia

198

 

https://::SaintMartin

199

 

https://::SaintPierreAndMiquelon

200

 

https://::SaintVincentAndGrenadines

201

 

https://::SaintVincentAndTheGrenadines

SaintVincentAndGrenadines

 

https://::Samoa

202

 

https://::SanMarino

203

 

https://::SaoTomeAndPrincipe

204

 

https://::SaudiArabia

205

 

https://::Senegal

206

 

https://::Serbia

207

 

https://::Seychelles

208

 

https://::SierraLeone

209

 

https://::Singapore

210

 

https://::SintMaarten

211

 

https://::Slovakia

212

 

https://::Slovenia

213

 

https://::SolomonIslands

214

 

https://::Somalia

215

 

https://::SouthAfrica

216

 

https://::SouthGeorgiaAndSouthSandwichIslands

217

 

https://::SouthGeorgiaAndTheSouthSandwichIslands

SouthGeorgiaAndSouthSandwichIslands

 

https://::SouthKorea

218

 

https://::SouthSudan

219

 

https://::Spain

220

 

https://::SriLanka

221

 

https://::Sudan

222

 

https://::Suriname

223

 

https://::SvalbardAndJanMayen

224

 

https://::SvalbardAndJanMayenIslands

SvalbardAndJanMayen

 

https://::Swaziland

Eswatini

 

https://::Sweden

225

 

https://::Switzerland

226

 

https://::Syria

227

 

https://::SyrianArabRepublic

Syria

Obsolete, use Syria instead

https://::Taiwan

228

 

https://::Tajikistan

229

 

https://::Tanzania

230

 

https://::Thailand

231

 

https://::TimorLeste

232

 

https://::Togo

233

 

https://::TokelauCountry

TokelauTerritory

Osbolete alias for TokelauTerritory

https://::TokelauTerritory

234

Since 6.2

https://::Tonga

235

 

https://::TrinidadAndTobago

236

 

https://::TristanDaCunha

237

 

https://::Tunisia

238

 

https://::Turkey

239

 

https://::Turkmenistan

240

 

https://::TurksAndCaicosIslands

241

 

https://::TuvaluCountry

TuvaluTerritory

Osbolete alias for TuvaluTerritory

https://::TuvaluTerritory

242

Since 6.2

https://::Uganda

243

 

https://::Ukraine

244

 

https://::UnitedArabEmirates

245

 

https://::UnitedKingdom

246

 

https://::UnitedStates

248

 

https://::UnitedStatesOutlyingIslands

247

 

https://::UnitedStatesMinorOutlyingIslands

UnitedStatesOutlyingIslands

 

https://::UnitedStatesVirginIslands

249

 

https://::Uruguay

250

 

https://::Uzbekistan

251

 

https://::Vanuatu

252

 

https://::VaticanCity

253

 

https://::VaticanCityState

VaticanCity

 

https://::Venezuela

254

 

https://::Vietnam

255

 

https://::WallisAndFutuna

256

 

https://::WallisAndFutunaIslands

WallisAndFutuna

 

https://::WesternSahara

257

 

https://::World

258

Since Qt 5.12

https://::Yemen

259

 

https://::Zambia

260

 

https://::Zimbabwe

261

 

Use the Territory alias for this enumeration where possible. The Country enum shall be renamed to Territory at a later release.

See Also▲

See also https://(), https://(), https://(), https://()

enum QLocale::CurrencySymbolFormat▲

Specifies the format of the currency symbol.

Constant

Value

Description

https://::CurrencyIsoCode

0

a ISO-4217 code of the currency.

https://::CurrencySymbol

1

a currency symbol.

https://::CurrencyDisplayName

2

a user readable name of the currency.

[since 5.10] enum QLocale::DataSizeFormat▲

flags QLocale::DataSizeFormats

Specifies the format for representation of data quantities.

Constant

Value

Description

https://::DataSizeIecFormat

0

format using base 1024 and IEC prefixes: KiB, MiB, GiB, ...

https://::DataSizeTraditionalFormat

DataSizeSIQuantifiers

format using base 1024 and SI prefixes: kB, MB, GB, ...

https://::DataSizeSIFormat

DataSizeBase1000 | DataSizeSIQuantifiers

format using base 1000 and SI prefixes: kB, MB, GB, ...

This enum was introduced or modified in Qt 5.10.

The DataSizeFormats type is a typedef for https://<DataSizeFormat>. It stores an OR combination of DataSizeFormat values.

See Also▲

See also https://()

[since 5.7] enum QLocale::FloatingPointPrecisionOption▲

This enum defines a constant that can be given as precision to https://(), https://(), and https://() when converting floats or doubles, in order to express a variable number of digits as precision.

Constant

Value

Description

https://::FloatingPointShortest

-128

The conversion algorithm will try to find the shortest accurate representation for the given number. "Accurate" means that you get the exact same number back from an inverse conversion on the generated string representation. In particular, trailing zeros are omitted (from the mantissa, in exponent formats).

This enum was introduced or modified in Qt 5.7.

See Also▲

See also https://(), https://(), https://()

enum QLocale::FormatType▲

This enum describes the different formats that can be used when converting https://, https://, and https:// objects, as well as months and days, to strings specific to the locale.

Constant

Value

Description

https://::LongFormat

0

Longer format.

https://::ShortFormat

1

Shorter format.

https://::NarrowFormat

2

A special version for use when space is very limited.

NarrowFormat might contain the same text for different months and days. 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.

See Also▲

See also https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://()

enum QLocale::Language▲

This enumerated type is used to specify a language.

Constant

Value

https://::AnyLanguage

0

 

https://::C

1

A simplified English locale; see https://()

https://::Abkhazian

2

 

https://::Afan

Oromo

Obsolete, please use Oromo

https://::Afar

3

 

https://::Afrikaans

4

 

https://::Aghem

5

 

https://::Akan

6

 

https://::Akkadian

7

Since Qt 5.1

https://::Akoose

8

Since Qt 5.3

https://::Albanian

9

 

https://::AmericanSignLanguage

10

Since Qt 5.7

https://::Amharic

11

 

https://::AncientEgyptian

12

Since Qt 5.1

https://::AncientGreek

13

Since Qt 5.1

https://::Arabic

14

 

https://::Aragonese

15

Since Qt 5.1

https://::Aramaic

16

Since Qt 5.1

https://::Armenian

17

 

https://::Assamese

18

 

https://::Asturian

19

 

https://::Asu

20

 

https://::Atsam

21

 

https://::Avaric

22

 

https://::Avestan

23

 

https://::Aymara

24

 

https://::Azerbaijani

25

 

https://::Bafia

26

 

https://::Balinese

27

Since Qt 5.1

https://::Bambara

28

 

https://::Bamun

29

Since Qt 5.1

https://::Bangla

30

Since Qt 6.0

https://::Basaa

31

 

https://::Bashkir

32

 

https://::Basque

33

 

https://::BatakToba

34

Since Qt 5.1

https://::Belarusian

35

 

https://::Bemba

36

 

https://::Bena

37

 

https://::Bengali

Bangla

Obsolete, please use Bangla

https://::Bhojpuri

38

Since Qt 5.7

https://::Bhutani

Dzongkha

Obsolete, please use Dzongkha

https://::Bislama

39

 

https://::Blin

40

 

https://::Bodo

41

 

https://::Bosnian

42

 

https://::Breton

43

 

https://::Buginese

44

Since Qt 5.1

https://::Bulgarian

45

 

https://::Burmese

46

 

https://::Byelorussian

Belarusian

Obsolete, please use Belarusian

https://::Cambodian

Khmer

Obsolete, please use Khmer

https://::Cantonese

47

Since Qt 5.7

https://::Catalan

48

 

https://::Cebuano

49

Since Qt 5.14

https://::CentralAtlasTamazight

50

Since Qt 6.0

https://::CentralKurdish

51

Since Qt 5.5

https://::CentralMoroccoTamazight

CentralAtlasTamazight

Obsolete, please use CentralAtlasTamazight

https://::Chakma

52

Since Qt 5.1

https://::Chamorro

53

 

https://::Chechen

54

 

https://::Cherokee

55

 

https://::Chewa

Nyanja

Obsolete, please use Nyanja

https://::Chickasaw

56

Since Qt 5.14

https://::Chiga

57

 

https://::Chinese

58

(Mandarin)

https://::Church

59

 

https://::Chuvash

60

 

https://::Colognian

61

 

https://::Coptic

62

Since Qt 5.1

https://::Cornish

63

 

https://::Corsican

64

 

https://::Cree

65

 

https://::Croatian

66

 

https://::Czech

67

 

https://::Danish

68

 

https://::Divehi

69

 

https://::Dogri

70

Since Qt 5.1

https://::Duala

71

 

https://::Dutch

72

 

https://::Dzongkha

73

 

https://::Embu

74

 

https://::English

75

 

https://::Erzya

76

Since Qt 5.14

https://::Esperanto

77

 

https://::Estonian

78

 

https://::Ewe

79

 

https://::Ewondo

80

 

https://::Faroese

81

 

https://::Fijian

82

 

https://::Filipino

83

 

https://::Finnish

84

 

https://::French

85

 

https://::Frisian

WesternFrisian

same as WesternFrisian

https://::Friulian

86

 

https://::Fulah

87

 

https://::Ga

89

 

https://::Gaelic

88

 

https://::Galician

90

 

https://::Ganda

91

 

https://::Geez

92

 

https://::Georgian

93

 

https://::German

94

 

https://::Gothic

95

Since Qt 5.1

https://::Greek

96

 

https://::Greenlandic

Kalaallisut

Obsolete, please use Kalaallisut

https://::Guarani

97

 

https://::Gujarati

98

 

https://::Gusii

99

 

https://::Haitian

100

 

https://::Hausa

101

 

https://::Hawaiian

102

 

https://::Hebrew

103

 

https://::Herero

104

 

https://::Hindi

105

 

https://::HiriMotu

106

 

https://::Hungarian

107

 

https://::Icelandic

108

 

https://::Ido

109

Since Qt 5.12

https://::Igbo

110

 

https://::InariSami

111

Since Qt 5.5

https://::Indonesian

112

 

https://::Ingush

113

Since Qt 5.1

https://::Interlingua

114

 

https://::Interlingue

115

 

https://::Inuktitut

116

 

https://::Inupiak

Inupiaq

Obsolete, please use Inupiaq

https://::Inupiaq

117

Since 6.0

https://::Irish

118

 

https://::Italian

119

 

https://::Japanese

120

 

https://::Javanese

121

 

https://::Jju

122

 

https://::JolaFonyi

123

 

https://::Kabuverdianu

124

 

https://::Kabyle

125

 

https://::Kaingang

328

Since 6.3

https://::Kako

126

 

https://::Kalaallisut

127

Since Qt 6.0

https://::Kalenjin

128

 

https://::Kamba

129

 

https://::Kannada

130

 

https://::Kanuri

131

 

https://::Kashmiri

132

 

https://::Kazakh

133

 

https://::Kenyang

134

Since Qt 5.5

https://::Khmer

135

 

https://::Kiche

136

Since Qt 5.5

https://::Kikuyu

137

 

https://::Kinyarwanda

138

 

https://::Kirghiz

Kyrgyz

Obsolete, please use Kyrgyz

https://::Komi

139

 

https://::Kongo

140

 

https://::Konkani

141

 

https://::Korean

142

 

https://::Koro

143

 

https://::KoyraboroSenni

144

 

https://::KoyraChiini

145

 

https://::Kpelle

146

 

https://::Kuanyama

147

Since 6.0

https://::Kurdish

148

 

https://::Kurundi

Rundi

Obsolete, please use Rundi

https://::Kwanyama

Kuanyama

Obsolete, please use Kuanyama

https://::Kwasio

149

 

https://::Kyrgyz

150

Since 6.0

https://::Lakota

151

Since Qt 5.3

https://::Langi

152

 

https://::Lao

153

 

https://::Latin

154

 

https://::Latvian

155

 

https://::Lezghian

156

Since Qt 5.5

https://::Limburgish

157

 

https://::Lingala

158

 

https://::LiteraryChinese

159

Since Qt 5.7

https://::Lithuanian

160

 

https://::Lojban

161

Since Qt 5.12

https://::LowerSorbian

162

Since Qt 5.5

https://::LowGerman

163

 

https://::LubaKatanga

164

 

https://::LuleSami

165

Since Qt 5.5

https://::Luo

166

 

https://::Luxembourgish

167

 

https://::Luyia

168

 

https://::Macedonian

169

 

https://::Machame

170

 

https://::Maithili

171

Since Qt 5.5

https://::MakhuwaMeetto

172

 

https://::Makonde

173

 

https://::Malagasy

174

 

https://::Malay

176

 

https://::Malayalam

175

 

https://::Maltese

177

 

https://::Mandingo

178

Since Qt 5.1

https://::Manipuri

179

Since Qt 5.1

https://::Manx

180

 

https://::Maori

181

 

https://::Mapuche

182

Since Qt 5.5

https://::Marathi

183

 

https://::Marshallese

184

 

https://::Masai

185

 

https://::Mazanderani

186

Since Qt 5.7

https://::Mende

187

Since Qt 5.5

https://::Meru

188

 

https://::Meta

189

 

https://::Mohawk

190

Since Qt 5.5

https://::Mongolian

191

 

https://::Morisyen

192

 

https://::Mundang

193

 

https://::Muscogee

194

Since Qt 5.14

https://::Nama

195

 

https://::NauruLanguage

196

 

https://::Navaho

Navajo

Obsolete, please use Navajo

https://::Navajo

197

Since 6.0

https://::Ndonga

198

 

https://::Nepali

199

 

https://::Newari

200

Since Qt 5.7

https://::Ngiemboon

201

 

https://::Nheengatu

329

Since 6.3

https://::NigerianPidgin

203

Since Qt 6.0

https://::Ngomba

202

 

https://::Nko

204

Since Qt 5.5

https://::NorthernLuri

205

Since Qt 5.7

https://::NorthernSami

206

 

https://::NorthernSotho

207

 

https://::NorthNdebele

208

 

https://::NorwegianBokmal

209

 

https://::NorwegianNynorsk

210

 

https://::Nuer

211

 

https://::Nyanja

212

 

https://::Nyankole

213

 

https://::Occitan

214

 

https://::Odia

215

Since 6.0

https://::Ojibwa

216

 

https://::OldIrish

217

Since Qt 5.1

https://::OldNorse

218

Since Qt 5.1

https://::OldPersian

219

Since Qt 5.1

https://::Oriya

Odia

Obsolete, please use Odia

https://::Oromo

220

 

https://::Osage

221

Since Qt 5.7

https://::Ossetic

222

 

https://::Pahlavi

223

Since Qt 5.1

https://::Palauan

224

Since Qt 5.7

https://::Pali

225

 

https://::Papiamento

226

Since Qt 5.7

https://::Pashto

227

 

https://::Persian

228

 

https://::Phoenician

229

Since Qt 5.1

https://::Polish

230

 

https://::Portuguese

231

 

https://::Prussian

232

Since Qt 5.5

https://::Punjabi

233

 

https://::Quechua

234

 

https://::RhaetoRomance

Romansh

Obsolete, please use Romansh

https://::Romanian

235

 

https://::Romansh

236

 

https://::Rombo

237

 

https://::Rundi

238

 

https://::Russian

239

 

https://::Rwa

240

 

https://::Saho

241

 

https://::Sakha

242

 

https://::Samburu

243

 

https://::Samoan

244

 

https://::Sango

245

 

https://::Sangu

246

 

https://::Sanskrit

247

 

https://::Santali

248

Since Qt 5.1

https://::Sardinian

249

 

https://::Saurashtra

250

Since Qt 5.1

https://::Sena

251

 

https://::Serbian

252

 

https://::Shambala

253

 

https://::Shona

254

 

https://::SichuanYi

255

 

https://::Sicilian

256

Since Qt 5.12

https://::Sidamo

257

 

https://::Silesian

258

Since Qt 5.14

https://::Sindhi

259

 

https://::Sinhala

260

 

https://::SkoltSami

261

Since Qt 5.5

https://::Slovak

262

 

https://::Slovenian

263

 

https://::Soga

264

 

https://::Somali

265

 

https://::SouthernKurdish

266

Since Qt 5.12

https://::SouthernSami

267

Since Qt 5.5

https://::SouthernSotho

268

 

https://::SouthNdebele

269

 

https://::Spanish

270

 

https://::StandardMoroccanTamazight

271

Since Qt 5.3

https://::Sundanese

272

 

https://::Swahili

273

 

https://::Swati

274

 

https://::Swedish

275

 

https://::SwissGerman

276

 

https://::Syriac

277

 

https://::Tachelhit

278

 

https://::Tahitian

279

 

https://::TaiDam

280

Since Qt 5.1

https://::Taita

281

 

https://::Tajik

282

 

https://::Tamil

283

 

https://::Taroko

284

 

https://::Tasawaq

285

 

https://::Tatar

286

 

https://::Telugu

287

 

https://::Teso

288

 

https://::Thai

289

 

https://::Tibetan

290

 

https://::Tigre

291

 

https://::Tigrinya

292

 

https://::TokelauLanguage

293

Since Qt 5.7

https://::TokPisin

294

Since Qt 5.7

https://::Tongan

295

 

https://::Tsonga

296

 

https://::Tswana

297

 

https://::Turkish

298

 

https://::Turkmen

299

 

https://::TuvaluLanguage

300

Since Qt 5.7

https://::Tyap

301

 

https://::Ugaritic

302

Since Qt 5.1

https://::Uighur

Uyghur

Obsolete, please use Uyghur

https://::Uigur

Uyghur

Obsolete, please use Uyghur

https://::Ukrainian

303

 

https://::UpperSorbian

304

Since Qt 5.5

https://::Urdu

305

 

https://::Uyghur

306

Since 6.0

https://::Uzbek

307

 

https://::Vai

308

 

https://::Venda

309

 

https://::Vietnamese

310

 

https://::Volapuk

311

 

https://::Vunjo

312

 

https://::Walamo

Wolaytta

Obsolete, please use Wolaytta

https://::Walloon

313

 

https://::Walser

314

 

https://::Warlpiri

315

Since Qt 5.5

https://::Welsh

316

 

https://::WesternBalochi

317

Since Qt 5.12

https://::WesternFrisian

318

same as Frisian

https://::Wolaytta

319

Since 6.0

https://::Wolof

320

 

https://::Xhosa

321

 

https://::Yangben

322

 

https://::Yiddish

323

 

https://::Yoruba

324

 

https://::Zarma

325

 

https://::Zhuang

326

 

https://::Zulu

327

 
See Also▲

See also https://(), https://()

enum QLocale::LanguageCodeType▲

flags QLocale::LanguageCodeTypes

This enum defines language code types that can be used to restrict set of language codes considered by codeToLanguage and languageToCode.

Constant

Value

Description

https://::ISO639Part1

1 << 0

ISO 639 Part 1 Alpha 2 code.

https://::ISO639Part2B

1 << 1

ISO 639 Part 2 bibliographic Alpha 3 code.

https://::ISO639Part2T

1 << 2

ISO 639 Part 2 terminological Alpha 3 code.

https://::ISO639Part3

1 << 3

ISO 639 Part 3 Alpha 3 code.

https://::LegacyLanguageCode

1 << 15

Codes that are not part of the above set, but that were supported by Qt in the past. This value can only be used by https://(). It is ignored when passed to https://().

https://::ISO639Part2

ISO639Part2B | ISO639Part2T

Any ISO 639 Part 2 code.

https://::ISO639Alpha2

ISO639Part1

Any ISO-639 2-letter code.

https://::ISO639Alpha3

ISO639Part2 | ISO639Part3

Any ISO-639 3-letter code.

https://::ISO639

ISO639Alpha2 | ISO639Alpha3

Any ISO 639 code.

https://::AnyLanguageCode

-1

Specifies that any code can be used.

The LanguageCodeTypes type is a typedef for https://<LanguageCodeType>. It stores an OR combination of LanguageCodeType values.

enum QLocale::MeasurementSystem▲

This enum defines which units are used for measurement.

Constant

Value

Description

https://::MetricSystem

0

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

https://::ImperialUSSystem

1

This value indicates imperial units, such as inches and miles as they are used in the United States.

https://::ImperialUKSystem

2

This value indicates imperial units, such as inches and miles as they are used in the United Kingdom.

https://::ImperialSystem

ImperialUSSystem

Provided for compatibility. Same as ImperialUSSystem

enum QLocale::NumberOption▲

flags QLocale::NumberOptions

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

Constant

Value

Description

https://::DefaultNumberOptions

0x0

This option represents the default behavior, with group separators, with one leading zero in single digit exponents, and without trailing zeroes after the decimal dot.

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

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

https://::OmitLeadingZeroInExponent

0x04

If this option is set, the number-to-string functions will not pad exponents with zeroes when printing floating point numbers in scientific notation. The default is to add one leading zero to single digit exponents.

https://::RejectLeadingZeroInExponent

0x08

If this option is set, the string-to-number functions will fail if they encounter an exponent padded with zeroes when parsing a floating point number in scientific notation. The default is to accept such padding.

https://::IncludeTrailingZeroesAfterDot

0x10

If this option is set, the number-to-string functions will pad numbers with zeroes to the requested precision in "g" or "most concise" mode, even if the number of significant digits is lower than the requested precision. The default is to omit trailing zeroes.

https://::RejectTrailingZeroesAfterDot

0x20

If this option is set, the string-to-number functions will fail if they encounter trailing zeroes after the decimal dot when parsing a number in scientific or decimal representation. The default is to accept trailing zeroes.

The NumberOptions type is a typedef for https://<NumberOption>. It stores an OR combination of NumberOption values.

See Also▲

See also https://(), https://(), https://

enum QLocale::QuotationStyle▲

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

Constant

Value

Description

https://::StandardQuotation

0

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

https://::AlternateQuotation

1

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

See Also▲

See also https://()

enum QLocale::Script▲

This enumerated type is used to specify a script.

Constant

Value

https://::AnyScript

0

 

https://::AdlamScript

1

Since Qt 5.7

https://::AhomScript

2

Since Qt 5.7

https://::AnatolianHieroglyphsScript

3

Since Qt 5.7

https://::ArabicScript

4

 

https://::ArmenianScript

5

 

https://::AvestanScript

6

Since Qt 5.1

https://::BalineseScript

7

Since Qt 5.1

https://::BamumScript

8

Since Qt 5.1

https://::BanglaScript

9

Since 6.0

https://::BassaVahScript

10

Since Qt 5.5

https://::BatakScript

11

Since Qt 5.1

https://::BengaliScript

BanglaScript

Obsolete, please use BanglaScript

https://::BhaiksukiScript

12

Since Qt 5.7

https://::BopomofoScript

13

Since Qt 5.1

https://::BrahmiScript

14

Since Qt 5.1

https://::BrailleScript

15

Since Qt 5.1

https://::BugineseScript

16

Since Qt 5.1

https://::BuhidScript

17

Since Qt 5.1

https://::CanadianAboriginalScript

18

Since Qt 5.1

https://::CarianScript

19

Since Qt 5.1

https://::CaucasianAlbanianScript

20

Since Qt 5.5

https://::ChakmaScript

21

Since Qt 5.1

https://::ChamScript

22

Since Qt 5.1

https://::CherokeeScript

23

 

https://::CopticScript

24

Since Qt 5.1

https://::CuneiformScript

25

Since Qt 5.1

https://::CypriotScript

26

Since Qt 5.1

https://::CyrillicScript

27

 

https://::DeseretScript

28

Since Qt 5.1

https://::DevanagariScript

29

 

https://::DuployanScript

30

Since Qt 5.5

https://::EgyptianHieroglyphsScript

31

Since Qt 5.1

https://::ElbasanScript

32

Since Qt 5.5

https://::EthiopicScript

33

 

https://::FraserScript

34

Since Qt 5.1

https://::GeorgianScript

35

 

https://::GlagoliticScript

36

Since Qt 5.1

https://::GothicScript

37

Since Qt 5.1

https://::GranthaScript

38

Since Qt 5.5

https://::GreekScript

39

 

https://::GujaratiScript

40

 

https://::GurmukhiScript

41

 

https://::HangulScript

42

Since Qt 5.1

https://::HanScript

43

Since Qt 5.1

https://::HanunooScript

44

Since Qt 5.1

https://::HanWithBopomofoScript

45

Since Qt 5.7

https://::HatranScript

46

Since Qt 5.7

https://::HebrewScript

47

 

https://::HiraganaScript

48

Since Qt 5.1

https://::ImperialAramaicScript

49

Since Qt 5.1

https://::InscriptionalPahlaviScript

50

Since Qt 5.1

https://::InscriptionalParthianScript

51

Since Qt 5.1

https://::JamoScript

52

Since Qt 5.7

https://::JapaneseScript

53

 

https://::JavaneseScript

54

Since Qt 5.1

https://::KaithiScript

55

Since Qt 5.1

https://::KannadaScript

56

 

https://::KatakanaScript

57

Since Qt 5.1

https://::KayahLiScript

58

Since Qt 5.1

https://::KharoshthiScript

59

Since Qt 5.1

https://::KhmerScript

60

Since Qt 5.1

https://::KhojkiScript

61

Since Qt 5.5

https://::KhudawadiScript

62

Since Qt 5.5

https://::KoreanScript

63

 

https://::LannaScript

64

Since Qt 5.1

https://::LaoScript

65

 

https://::LatinScript

66

 

https://::LepchaScript

67

Since Qt 5.1

https://::LimbuScript

68

Since Qt 5.1

https://::LinearAScript

69

Since Qt 5.5

https://::LinearBScript

70

Since Qt 5.1

https://::LycianScript

71

Since Qt 5.1

https://::LydianScript

72

Since Qt 5.1

https://::MahajaniScript

73

Since Qt 5.5

https://::MalayalamScript

74

 

https://::MandaeanScript

75

Since Qt 5.1

https://::ManichaeanScript

76

Since Qt 5.5

https://::MarchenScript

77

Since Qt 5.7

https://::MeiteiMayekScript

78

Since Qt 5.1

https://::MendeScript

79

Since Qt 6.0

https://::MendeKikakuiScript

MendeScript

Obsolete, please use MendeScript

https://::MeroiticCursiveScript

80

Since Qt 5.1

https://::MeroiticScript

81

Since Qt 5.1

https://::ModiScript

82

Since Qt 5.5

https://::MongolianScript

83

 

https://::MroScript

84

Since Qt 5.5

https://::MultaniScript

85

Since Qt 5.7

https://::MyanmarScript

86

 

https://::NabataeanScript

87

Since Qt 5.5

https://::NewaScript

88

Since Qt 5.7

https://::NewTaiLueScript

89

Since Qt 5.1

https://::NkoScript

90

Since Qt 5.1

https://::OghamScript

92

Since Qt 5.1

https://::OlChikiScript

93

Since Qt 5.1

https://::OldHungarianScript

94

Since Qt 5.7

https://::OldItalicScript

95

Since Qt 5.1

https://::OldNorthArabianScript

96

Since Qt 5.5

https://::OldPermicScript

97

Since Qt 5.5

https://::OldPersianScript

98

Since Qt 5.1

https://::OldSouthArabianScript

99

Since Qt 5.1

https://::OdiaScript

91

Since 6.0

https://::OriyaScript

OdiaScript

Obsolete, please use OdiaScript

https://::OrkhonScript

100

Since Qt 5.1

https://::OsageScript

101

Since Qt 5.7

https://::OsmanyaScript

102

Since Qt 5.1

https://::PahawhHmongScript

103

Since Qt 5.5

https://::PalmyreneScript

104

Since Qt 5.5

https://::PauCinHauScript

105

Since Qt 5.5

https://::PhagsPaScript

106

Since Qt 5.1

https://::PhoenicianScript

107

Since Qt 5.1

https://::PollardPhoneticScript

108

Since Qt 5.1

https://::PsalterPahlaviScript

109

Since Qt 5.5

https://::RejangScript

110

Since Qt 5.1

https://::RunicScript

111

Since Qt 5.1

https://::SamaritanScript

112

Since Qt 5.1

https://::SaurashtraScript

113

Since Qt 5.1

https://::SharadaScript

114

Since Qt 5.1

https://::ShavianScript

115

Since Qt 5.1

https://::SiddhamScript

116

Since Qt 5.5

https://::SignWritingScript

117

Since Qt 5.7

https://::SimplifiedChineseScript

SimplifiedHanScript

same as SimplifiedHanScript

https://::SimplifiedHanScript

118

same as SimplifiedChineseScript

https://::SinhalaScript

119

 

https://::SoraSompengScript

120

Since Qt 5.1

https://::SundaneseScript

121

Since Qt 5.1

https://::SylotiNagriScript

122

Since Qt 5.1

https://::SyriacScript

123

 

https://::TagalogScript

124

Since Qt 5.1

https://::TagbanwaScript

125

Since Qt 5.1

https://::TaiLeScript

126

Since Qt 5.1

https://::TaiVietScript

127

Since Qt 5.1

https://::TakriScript

128

Since Qt 5.1

https://::TamilScript

129

 

https://::TangutScript

130

Since Qt 5.7

https://::TeluguScript

131

 

https://::ThaanaScript

132

 

https://::ThaiScript

133

 

https://::TibetanScript

134

 

https://::TifinaghScript

135

 

https://::TirhutaScript

136

Since Qt 5.5

https://::TraditionalChineseScript

TraditionalHanScript

same as TraditionalHanScript

https://::TraditionalHanScript

137

same as TraditionalChineseScript

https://::UgariticScript

138

Since Qt 5.1

https://::VaiScript

139

 

https://::VarangKshitiScript

140

Since Qt 5.5

https://::YiScript

141

 
See Also▲

See also https://(), https://(), https://()

[alias] QLocale::Territory▲

This enumeration type is an alias for https://, which shall be renamed to Territory at a future release.

See Also▲

See also https://(), https://()

Member Function Documentation▲

 

QLocale::QLocale()▲

Constructs a https:// object initialized with the default locale.

If no default locale was set using https://(), this locale will be the same as the one returned by https://().

See Also▲

See also https://(), https://()

[explicit] QLocale::QLocale(const QString &name)▲

This is an overloaded function.

[explicit, since 6.3] QLocale::QLocale(QStringView name)▲

Constructs a https:// object with the specified name.

The name has the format "language[_script][_territory][.codeset][@modifier]" or "C", where:

  • language is a lowercase, two-letter, ISO 639 language code (some three-letter codes are also recognized),

  • script is a capitalized, four-letter, ISO 15924 script code,

  • territory is an uppercase, two-letter, ISO 3166 territory code (some numeric codes are also recognized), and

  • codeset and modifier are ignored.

The separator can be either underscore '_' (U+005F, "low line") or a dash '-' (U+002D, "hyphen-minus"). If https:// has no data for the specified combination of language, script, and territory, then it uses the most suitable match it can find instead. If the string violates the locale format, or no suitable data can be found for the specified keys, the "C" locale is used instead.

This constructor is much slower than https://(Language, Script, Territory) or https://(Language, Territory).

This function was introduced in Qt 6.3.

See Also▲

See also https://(), https://

QLocale::QLocale(QLocale::Language language, QLocale::Territory territory)▲

Constructs a https:// object for the specified language and territory.

If there is more than one script in use for this combination, a likely script will be selected. If https:// has no data for the specified language, the default locale is used. If https:// has no data for the specified combination of language and territory, an alternative territory may be used instead.

See Also▲

See also https://(), https://

QLocale::QLocale(QLocale::Language language, QLocale::Script script = AnyScript, QLocale::Territory territory = AnyTerritory)▲

Constructs a https:// object for the specified language, script and territory.

If https:// does not have data for the given combination, it will find data for as good a match as it can. It falls back on the default locale if

  • language is AnyLanguage and no language can be inferred from script and territory

  • https:// has no data for the language, either given as language or inferred as above.

See Also▲

See also https://(), https://

QLocale::QLocale(const QLocale &other)▲

Constructs a https:// object as a copy of other.

QLocale::~QLocale()▲

Destructor

QString QLocale::amText() const▲

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

See Also▲

See also https://()

QString QLocale::bcp47Name() const▲

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

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

This function tries to conform the locale name to BCP47.

See Also▲

See also https://(), https://(), https://(), https://()

[static] QLocale QLocale::c()▲

Returns a https:// object initialized to the "C" locale.

This locale is based on en_US but with various quirks of its own, such as simplified number formatting and its own date formatting. It implements the POSIX standards that describe the behavior of standard library functions of the "C" programming language.

Among other things, this means its collation order is based on the ASCII values of letters, so that (for case-sensitive sorting) all upper-case letters sort before any lower-case one (rather than each letter's upper- and lower-case forms sorting adjacent to one another, before the next letter's two forms).

See Also▲

See also https://()

[static, since 6.3] QLocale::Language QLocale::codeToLanguage(QStringView languageCode, QLocale::LanguageCodeTypes codeTypes = AnyLanguageCode)▲

Returns the https:// enum corresponding to the two- or three-letter languageCode, as defined in the ISO 639 standards.

If specified, codeTypes selects which set of codes to consider for conversion. By default all codes known to Qt are considered. The codes are matched in the following order: ISO639Part1, ISO639Part2B, ISO639Part2T, ISO639Part3, LegacyLanguageCode.

If the code is invalid or not known QLocale::AnyLanguage is returned.

This function was introduced in Qt 6.3.

See Also▲

See also https://(), https://(), https://()

[static, since 6.1] QLocale::Script QLocale::codeToScript(QStringView scriptCode)▲

Returns the https:// enum corresponding to the four-letter script scriptCode, as defined in the ISO 15924 standard.

If the code is invalid or not known https:// is returned.

This function was introduced in Qt 6.1.

See Also▲

See also https://(), https://(), https://()

[static, since 6.2] QLocale::Territory QLocale::codeToTerritory(QStringView territoryCode)▲

Returns the https:// enum corresponding to the two-letter or three-digit territoryCode, as defined in the ISO 3166 standard.

If the code is invalid or not known https:// is returned.

This function was introduced in Qt 6.2.

See Also▲

See also https://(), https://(), https://()

[since 5.13] QLocale QLocale::collation() const▲

Returns the locale to use for collation.

The result is usually this locale; however, the system locale (which is commonly the default locale) will return the system collation locale. The result is suitable for passing to https://'s constructor.

This function was introduced in Qt 5.13.

See Also▲

See also https://

QString QLocale::createSeparatedList(const QStringList &list) const▲

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

QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat format = CurrencySymbol) const▲

Returns a currency symbol according to the format.

QString QLocale::dateFormat(QLocale::FormatType format = LongFormat) const▲

Returns the date format used for the current locale.

If format is https://, the format will be elaborate, otherwise it will be short. For example, https:// for the en_US locale is dddd, MMMM d, yyyy, https:// is M/d/yy.

See Also▲

See also https://(), https://()

QString QLocale::dateTimeFormat(QLocale::FormatType format = LongFormat) const▲

Returns the date time format used for the current locale.

If format is https://, the format will be elaborate, otherwise it will be short. For example, https:// for the en_US locale is dddd, MMMM d, yyyy h:mm:ss AP t, https:// is M/d/yy h:mm AP.

See Also▲

See also https://(), https://()

QString QLocale::dayName(int day, QLocale::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.

For example, if the locale is en_US and day is 1, https:// will return Monday, https:// Mon, and https:// M.

See Also▲

See also https://(), https://()

QString QLocale::decimalPoint() const▲

Returns the decimal point character of this locale.

See Also▲

See also https://(), https://()

QString QLocale::exponential() const▲

Returns the exponential character of this locale, used to separate exponent from mantissa in some floating-point numeric representations.

See Also▲

See also https://(double, char, int)

Qt::DayOfWeek QLocale::firstDayOfWeek() const▲

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

[since 5.10] QString QLocale::formattedDataSize(qint64 bytes, int precision = 2, QLocale::DataSizeFormats format = DataSizeIecFormat) const▲

Converts a size in bytes to a human-readable localized string, comprising a number and a quantified unit. The quantifier is chosen such that the number is at least one, and as small as possible. For example if bytes is 16384, precision is 2, and format is https:// (the default), this function returns "16.00 KiB"; for 1330409069609 bytes it returns "1.21 GiB"; and so on. If format is https:// or https://, the given number of bytes is divided by a power of 1024, with result less than 1024; for https://, it is divided by a power of 1000, with result less than 1000. DataSizeIecFormat uses the new IEC standard quantifiers Ki, Mi and so on, whereas DataSizeSIFormat uses the older SI quantifiers k, M, etc., and DataSizeTraditionalFormat abuses them.

This function was introduced in Qt 5.10.

QString QLocale::groupSeparator() const▲

Returns the group separator character of this locale.

See Also▲

See also https://(), https://()

QLocale::Language QLocale::language() const▲

Returns the language of this locale.

See Also▲

See also https://(), https://(), https://(), https://()

[static, since 6.3] QString QLocale::languageToCode(QLocale::Language language, QLocale::LanguageCodeTypes codeTypes = AnyLanguageCode)▲

Returns the two- or three-letter language code for language, as defined in the ISO 639 standards.

If specified, codeTypes selects which set of codes to consider. The first code from the set that is defined for language is returned. Otherwise, all ISO-639 codes are considered. The codes are considered in the following order: ISO639Part1, ISO639Part2B, ISO639Part2T, ISO639Part3. LegacyLanguageCode is ignored by this function.

For QLocale::C the function returns "C". For QLocale::AnyLanguage an empty string is returned. If the language has no code in any selected code set, an empty string is returned.

This function was introduced in Qt 6.3.

See Also▲

See also https://(), https://(), https://(), https://(), https://(), https://()

[static] QString QLocale::languageToString(QLocale::Language language)▲

Returns a https:// containing the name of language.

See Also▲

See also https://(), https://(), https://()

[static] QList<QLocale> QLocale::matchingLocales(QLocale::Language language, QLocale::Script script, QLocale::Territory territory)▲

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

Getting a list of all locales: https://<https://> allLocales = QLocale::matchingLocales(https://, https://, https://);

Getting a list of locales suitable for Russia: https://<https://> locales = QLocale::matchingLocales(https://, https://, https://);

QLocale::MeasurementSystem QLocale::measurementSystem() const▲

Returns the measurement system for the locale.

QString QLocale::monthName(int month, QLocale::FormatType type = LongFormat) const▲

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

For example, if the locale is en_US and month is 1, https:// will return January. https:// Jan, and https:// J.

See Also▲

See also https://(), https://()

QString QLocale::name() 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- or three-letter ISO 3166 country code.

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

See Also▲

See also https://(), https://(), https://(), https://(), https://()

QString QLocale::nativeLanguageName() const▲

Returns a native name of the language for the locale. For example "Schwiizertüütsch" for Swiss-German locale.

See Also▲

See also https://(), https://()

[since 6.2] QString QLocale::nativeTerritoryName() const▲

Returns a native name of the territory for the locale. For example "España" for Spanish/Spain locale.

This function was introduced in Qt 6.2.

See Also▲

See also https://(), https://()

QString QLocale::negativeSign() const▲

Returns the negative sign character of this locale.

See Also▲

See also https://(), https://()

QLocale::NumberOptions QLocale::numberOptions() const▲

Returns the options related to number conversions for this https:// instance.

By default, no options are set for the standard locales, except for the "C" locale, which has https:// set by default.

See Also▲

See also https://(), https://(), https://(), https://

QString QLocale::percent() const▲

Returns the percent character of this locale.

See Also▲

See also https://()

QString QLocale::pmText() const▲

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

See Also▲

See also https://()

QString QLocale::positiveSign() const▲

Returns the positive sign character of this locale.

See Also▲

See also https://(), https://()

QString QLocale::quoteString(const QString &str, QLocale::QuotationStyle style = StandardQuotation) const▲

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

[since 6.0] QString QLocale::quoteString(QStringView str, QLocale::QuotationStyle style = StandardQuotation) const▲

This is an overloaded function.

This function was introduced in Qt 6.0.

QLocale::Script QLocale::script() const▲

Returns the script of this locale.

See Also▲

See also https://(), https://(), https://(), https://(), https://()

[static, since 6.1] QString QLocale::scriptToCode(QLocale::Script script)▲

Returns the four-letter script code for script, as defined in the ISO 15924 standard.

For QLocale::AnyScript an empty string is returned.

This function was introduced in Qt 6.1.

See Also▲

See also https://(), https://(), https://(), https://(), https://()

[static] QString QLocale::scriptToString(QLocale::Script script)▲

Returns a https:// containing the name of script.

See Also▲

See also https://(), https://(), https://(), https://()

[static] void QLocale::setDefault(const QLocale &locale)▲

Sets the global default locale to locale. These values are used when a https:// object is constructed with no arguments. If this function is not called, the system's locale is used.

In a multithreaded application, the default locale should be set at application startup, before any non-GUI threads are created.

This function is not reentrant.

See Also▲

See also https://(), https://()

void QLocale::setNumberOptions(QLocale::NumberOptions options)▲

Sets the options related to number conversions for this https:// instance.

See Also▲

See also https://(), https://

QString QLocale::standaloneDayName(int day, QLocale::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 https://().

See Also▲

See also https://(), https://()

QString QLocale::standaloneMonthName(int month, QLocale::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 https://().

See Also▲

See also https://(), https://()

[since 5.6] void QLocale::swap(QLocale &other)▲

Swaps locale other with this locale. This operation is very fast and never fails.

This function was introduced in Qt 5.6.

[static] QLocale QLocale::system()▲

Returns a https:// object initialized to the system locale.

The system locale may use system-specific sources for locale data, where available, otherwise falling back on https://'s built-in database entry for the language, script and territory the system reports.

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

See Also▲

See also https://()

[since 6.2] QLocale::Territory QLocale::territory() const▲

Returns the territory of this locale.

This function was introduced in Qt 6.2.

See Also▲

See also https://(), https://(), https://(), https://()

[static, since 6.2] QString QLocale::territoryToCode(QLocale::Territory territory)▲

Returns the two-letter territory code for territory, as defined in the ISO 3166 standard.

For QLocale::AnyTerritory an empty string is returned.

This function was introduced in Qt 6.2.

See Also▲

See also https://(), https://(), https://(), https://(), https://(), https://()

[static, since 6.2] QString QLocale::territoryToString(QLocale::Territory territory)▲

Returns a https:// containing the name of territory.

This function was introduced in Qt 6.2.

See Also▲

See also https://(), https://(), https://(), https://()

Qt::LayoutDirection QLocale::textDirection() const▲

Returns the text direction of the language.

QString QLocale::timeFormat(QLocale::FormatType format = LongFormat) const▲

Returns the time format used for the current locale.

If format is https://, the format will be elaborate, otherwise it will be short. For example, https:// for the en_US locale is h:mm:ss AP t, https:// is h:mm AP.

See Also▲

See also https://(), https://()

QString QLocale::toCurrencyString(qlonglong value, const QString &symbol = QString()) const▲

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

See Also▲

See also https://()

QString QLocale::toCurrencyString(qulonglong value, const QString &symbol = QString()) const▲

This is an overloaded function.

QString QLocale::toCurrencyString(short value, const QString &symbol = QString()) const▲

This is an overloaded function.

QString QLocale::toCurrencyString(ushort value, const QString &symbol = QString()) const▲

This is an overloaded function.

QString QLocale::toCurrencyString(int value, const QString &symbol = QString()) const▲

This is an overloaded function.

QString QLocale::toCurrencyString(uint value, const QString &symbol = QString()) const▲

This is an overloaded function.

[since 5.7] QString QLocale::toCurrencyString(double value, const QString &symbol = QString(), int precision = -1) const▲

This function overloads https://().

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

This function was introduced in Qt 5.7.

See Also▲

See also https://()

QString QLocale::toCurrencyString(float i, const QString &symbol = QString(), int precision = -1) const▲

This function overloads https://().

QDate QLocale::toDate(const QString &string, QLocale::FormatType format = LongFormat) const▲

Reads string as a date in a locale-specific format.

Parses string and returns the date it represents. The format of the date string is chosen according to the format parameter (see https://()).

Month and day names, where used, must be given in the locale's language.

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

See Also▲

See also https://(), https://(), https://(), https://()

QDate QLocale::toDate(const QString &string, const QString &format) const▲

Reads string as a date in the given format.

Parses string and returns the date it represents. See https://() for the interpretation of format.

Month and day names, where used, must be given in the locale's language.

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

See Also▲

See also https://(), https://(), https://(), https://()

[since 5.14] QDate QLocale::toDate(const QString &string, QLocale::FormatType format, QCalendar cal) const▲

This is an overloaded function.

This function was introduced in Qt 5.14.

[since 5.14] QDate QLocale::toDate(const QString &string, const QString &format, QCalendar cal) const▲

This is an overloaded function.

This function was introduced in Qt 5.14.

QDateTime QLocale::toDateTime(const QString &string, QLocale::FormatType format = LongFormat) const▲

Reads string as a date-time in a locale-specific format.

Parses string and returns the date-time it represents. The format of the date string is chosen according to the format parameter (see https://()).

Month and day names, where used, must be given in the locale's language. Any am/pm indicators used must match https://() or https://(), ignoring case.

If the string could not be parsed, returns an invalid https://.

See Also▲

See also https://(), https://(), https://(), https://()

QDateTime QLocale::toDateTime(const QString &string, const QString &format) const▲

Reads string as a date-time in the given format.

Parses string and returns the date-time it represents. See https://() for the interpretation of format.

Month and day names, where used, must be given in the locale's language. Any am/pm indicators used must match https://() or https://(), ignoring case.

If the string could not be parsed, returns an invalid https://. If the string can be parsed and represents an invalid date-time (e.g. in a gap skipped by a time-zone transition), an invalid https:// is returned, whose toMSecsSinceEpoch() represents a near-by date-time that is valid. Passing that to fromMSecsSinceEpoch() will produce a valid date-time that isn't faithfully represented by the string parsed.

See Also▲

See also https://(), https://(), https://(), https://()

[since 5.14] QDateTime QLocale::toDateTime(const QString &string, QLocale::FormatType format, QCalendar cal) const▲

This is an overloaded function.

This function was introduced in Qt 5.14.

[since 5.14] QDateTime QLocale::toDateTime(const QString &string, const QString &format, QCalendar cal) const▲

This is an overloaded function.

This function was introduced in Qt 5.14.

double QLocale::toDouble(const QString &s, bool *ok = nullptr) const▲

Returns the double represented by the localized string s.

Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function does not fall back to the 'C' locale if the string cannot be interpreted in this locale.

 
Sélectionnez
bool ok;
double d;

QLocale c(QLocale::C);
d = c.toDouble("1234.56", &amp;ok);  // ok == true,  d == 1234.56
d = c.toDouble("1,234.56", &amp;ok); // ok == true,  d == 1234.56
d = c.toDouble("1234,56", &amp;ok);  // ok == false, d == 0

QLocale german(QLocale::German);
d = german.toDouble("1234,56", &amp;ok);  // ok == true,  d == 1234.56
d = german.toDouble("1.234,56", &amp;ok); // ok == true,  d == 1234.56
d = german.toDouble("1234.56", &amp;ok);  // ok == false, d == 0

d = german.toDouble("1.234", &amp;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▲

See also https://(), https://(), https://()

[since 5.10] double QLocale::toDouble(QStringView s, bool *ok = nullptr) const▲

Returns the double represented by the localized string s.

Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

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

 
Sélectionnez
bool ok;
double d;

QLocale c(QLocale::C);
d = c.toDouble(u"1234.56", &amp;ok);  // ok == true,  d == 1234.56
d = c.toDouble(u"1,234.56", &amp;ok); // ok == true,  d == 1234.56
d = c.toDouble(u"1234,56", &amp;ok);  // ok == false, d == 0

QLocale german(QLocale::German);
d = german.toDouble(u"1234,56", &amp;ok);  // ok == true,  d == 1234.56
d = german.toDouble(u"1.234,56", &amp;ok); // ok == true,  d == 1234.56
d = german.toDouble(u"1234.56", &amp;ok);  // ok == false, d == 0

d = german.toDouble(u"1.234", &amp;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.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://(), https://()

float QLocale::toFloat(const QString &s, bool *ok = nullptr) const▲

Returns the float represented by the localized string s.

Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function does not fall back to the 'C' locale if the string cannot be interpreted in this locale.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://(), https://()

[since 5.10] float QLocale::toFloat(QStringView s, bool *ok = nullptr) const▲

Returns the float represented by the localized string s.

Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://(), https://()

int QLocale::toInt(const QString &s, bool *ok = nullptr) const▲

Returns the int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://()

[since 5.10] int QLocale::toInt(QStringView s, bool *ok = nullptr) const▲

Returns the int represented by the localized string s.

If the conversion fails, the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://()

[since 5.13] long QLocale::toLong(const QString &s, bool *ok = nullptr) const▲

Returns the long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.13.

See Also▲

See also https://(), https://(), https://(), https://()

[since 5.13] long QLocale::toLong(QStringView s, bool *ok = nullptr) const▲

Returns the long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.13.

See Also▲

See also https://(), https://(), https://(), https://()

qlonglong QLocale::toLongLong(const QString &s, bool *ok = nullptr) const▲

Returns the long long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://(), https://(), https://()

[since 5.10] qlonglong QLocale::toLongLong(QStringView s, bool *ok = nullptr) const▲

Returns the long long int represented by the localized string s.

If the conversion fails, the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://(), https://(), https://()

QString QLocale::toLower(const QString &str) const▲

Returns a lowercase copy of str.

If Qt Core is using the ICU libraries, they will be used to perform the transformation according to the rules of the current locale. Otherwise the conversion may be done in a platform-dependent manner, with https://() as a generic fallback.

See Also▲

See also https://()

short QLocale::toShort(const QString &s, bool *ok = nullptr) const▲

Returns the short int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://()

[since 5.10] short QLocale::toShort(QStringView s, bool *ok = nullptr) const▲

Returns the short int represented by the localized string s.

If the conversion fails, the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://()

QString QLocale::toString(qlonglong i) const▲

Returns a localized string representation of i.

See Also▲

See also https://(), https://(), https://(), https://()

QString QLocale::toString(qulonglong i) const▲

This is an overloaded function.

See Also▲

See also https://(), https://(), https://(), https://()

QString QLocale::toString(long i) const▲

This is an overloaded function.

See Also▲

See also https://()

QString QLocale::toString(ulong i) const▲

This is an overloaded function.

See Also▲

See also https://()

QString QLocale::toString(short i) const▲

This is an overloaded function.

See Also▲

See also https://()

QString QLocale::toString(ushort i) const▲

This is an overloaded function.

See Also▲

See also https://()

QString QLocale::toString(int i) const▲

This is an overloaded function.

See Also▲

See also https://()

QString QLocale::toString(uint i) const▲

This is an overloaded function.

See Also▲

See also https://()

QString QLocale::toString(double f, char format = 'g', int precision = 6) const▲

This is an overloaded function.

Returns a string representing the floating-point number f.

The form of the representation is controlled by the format and precision parameters.

The format defaults to 'g'. It can be any of the following:

Format

Meaning

'e'

format as [-]9.9e[+|-]999

'E'

format as [-]9.9E[+|-]999

'f'

format as [-]9.9

'g'

use 'e' or 'f' format, whichever is more concise

'G'

use 'E' or 'f' format, whichever is more concise

For the 'e', 'E', and 'f' formats, the precision represents the number of digits after the decimal point. For the 'g' and 'G' formats, the precision represents the maximum number of significant digits (trailing zeroes are omitted). The special precision value https:// selects the shortest representation that, when read as a number, gets back the original floating-point value. Aside from that, any negative precision is ignored in favor of the default, 6.

For the 'e', 'f' and 'g' formats, positive infinity is represented as "inf", negative infinity as "-inf" and floating-point NaN (not-a-number) values are represented as "nan". For the 'E' and 'G' formats, "INF" and "NAN" are used instead. This does not vary with locale.

See Also▲

See also https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://

QString QLocale::toString(float f, char format = 'g', int precision = 6) const▲

This is an overloaded function.

Returns a string representing the floating-point number f.

The format and precision have the same meanings as described in https://(double, char, int).

See Also▲

See also https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://(), https://

QString QLocale::toString(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.

See Also▲

See also https://()

QString QLocale::toString(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.

See Also▲

See also https://()

QString QLocale::toString(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.

See Also▲

See also https://(), https://(), https://()

[since 5.10] QString QLocale::toString(QDate date, QStringView format) const▲

This is an overloaded function.

This function was introduced in Qt 5.10.

QString QLocale::toString(QTime time, QStringView 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.

See Also▲

See also https://()

[since 5.10] QString QLocale::toString(const QDateTime &dateTime, QStringView format) const▲

This is an overloaded function.

This function was introduced in Qt 5.10.

QString QLocale::toString(QDate date, QLocale::FormatType format = LongFormat) const▲

This is an overloaded function.

QString QLocale::toString(QTime time, QLocale::FormatType format = LongFormat) const▲

Returns a localized string representation of the given time in the specified format (see https://()).

QString QLocale::toString(const QDateTime &dateTime, QLocale::FormatType format = LongFormat) const▲

This is an overloaded function.

[since 5.14] QString QLocale::toString(QDate date, QStringView format, QCalendar cal) const▲

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

This function was introduced in Qt 5.14.

See Also▲

See also https://()

[since 5.14] QString QLocale::toString(QDate date, QLocale::FormatType format, QCalendar cal) const▲

Returns a localized string representation of the given date according to the specified format (see https://()), optionally for a specified calendar cal.

Some locales may use formats that limit the range of years they can represent.

This function was introduced in Qt 5.14.

[since 5.14] QString QLocale::toString(const QDateTime &dateTime, QLocale::FormatType format, QCalendar cal) const▲

Returns a localized string representation of the given dateTime according to the specified format (see https://()), optionally for a specified calendar cal.

Some locales may use formats that limit the range of years they can represent.

This function was introduced in Qt 5.14.

[since 5.14] QString QLocale::toString(const QDateTime &dateTime, QStringView format, QCalendar cal) const▲

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

This function was introduced in Qt 5.14.

See Also▲

See also https://(), https://(), https://()

QTime QLocale::toTime(const QString &string, QLocale::FormatType format = LongFormat) const▲

Reads string as a time in a locale-specific format.

Parses string and returns the time it represents. The format of the time string is chosen according to the format parameter (see https://()).

Any am/pm indicators used must match https://() or https://(), ignoring case.

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

See Also▲

See also https://(), https://(), https://(), https://()

QTime QLocale::toTime(const QString &string, const QString &format) const▲

Reads string as a time in the given format.

Parses string and returns the time it represents. See https://() for the interpretation of format.

Any am/pm indicators used must match https://() or https://(), ignoring case.

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

See Also▲

See also https://(), https://(), https://(), https://()

uint QLocale::toUInt(const QString &s, bool *ok = nullptr) const▲

Returns the unsigned int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://()

[since 5.10] uint QLocale::toUInt(QStringView s, bool *ok = nullptr) const▲

Returns the unsigned int represented by the localized string s.

If the conversion fails, the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://()

[since 5.13] ulong QLocale::toULong(const QString &s, bool *ok = nullptr) const▲

Returns the unsigned long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.13.

See Also▲

See also https://(), https://(), https://(), https://()

[since 5.13] ulong QLocale::toULong(QStringView s, bool *ok = nullptr) const▲

Returns the unsigned long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.13.

See Also▲

See also https://(), https://(), https://(), https://()

qulonglong QLocale::toULongLong(const QString &s, bool *ok = nullptr) const▲

Returns the unsigned long long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://(), https://(), https://()

[since 5.10] qulonglong QLocale::toULongLong(QStringView s, bool *ok = nullptr) const▲

Returns the unsigned long long int represented by the localized string s.

If the conversion fails, the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://(), https://(), https://()

ushort QLocale::toUShort(const QString &s, bool *ok = nullptr) const▲

Returns the unsigned short int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

See Also▲

See also https://(), https://()

[since 5.10] ushort QLocale::toUShort(QStringView s, bool *ok = nullptr) const▲

Returns the unsigned short int represented by the localized string s.

If the conversion fails, the function returns 0.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.10.

See Also▲

See also https://(), https://()

QString QLocale::toUpper(const QString &str) const▲

Returns an uppercase copy of str.

If Qt Core is using the ICU libraries, they will be used to perform the transformation according to the rules of the current locale. Otherwise the conversion may be done in a platform-dependent manner, with https://() as a generic fallback.

See Also▲

See also https://()

QStringList QLocale::uiLanguages() const▲

Returns an ordered list of locale names for translation purposes in preference order (like "en-Latn-US", "en-US", "en").

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 https:// object to the https://() function.

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

See Also▲

See also https://, https://()

QList<Qt::DayOfWeek> QLocale::weekdays() const▲

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

QString QLocale::zeroDigit() const▲

Returns the zero digit character of this locale.

See Also▲

See also https://()

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

Assigns other to this https:// object and returns a reference to this https:// object.

Related Non-Members▲

 

[since 5.6] size_t qHash(const QLocale &key, size_t seed = 0)▲

Returns the hash value for key, using seed to seed the calculation.

This function was introduced in Qt 5.6.

bool operator!=(const QLocale &lhs, const QLocale &rhs)▲

Returns true if the two https:// objects, lhs and rhs, differ; otherwise returns false.

The system locale is not equal to the https:// object constructed from its https://(), https://() and https://(), even if the two agree in all data fields. Nor are two locales with different number options equal.

See Also▲

See also https://(), https://()

bool operator==(const QLocale &lhs, const QLocale &rhs)▲

Returns true if the two https:// objects, lhs and rhs, are the same; otherwise returns false.

The system locale is not equal to the https:// object constructed from its https://(), https://() and https://(), even if the two agree in all data fields. Nor are two locales with different number options equal.

See Also▲

See also https://(), https://()

Obsolete Members for QLocale▲

The following members of class https:// are deprecated. We strongly advise against using them in new code.

Obsolete Member Function Documentation▲

 
[static, since 6.1] QLocale::Country QLocale::codeToCountry(QStringView countryCode)▲

This function is deprecated since 6.6. We strongly advise against using it in new code.

Returns the https:// enum corresponding to the two-letter or three-digit countryCode, as defined in the ISO 3166 standard.

If the code is invalid or not known https:// is returned.

Use https://(https://) instead.

This function was introduced in Qt 6.1.

See Also▲

See also https://(), https://(), https://()

[static] QList<QLocale::Country> QLocale::countriesForLanguage(QLocale::Language language)▲

This function is deprecated since 6.6. We strongly advise against using it in new code.

Use https://() instead and consult the https://() of each.

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

See Also▲

See also https://()

QLocale::Country QLocale::country() const▲

This function is deprecated since 6.6. We strongly advise against using it in new code.

Use https://() instead.

Returns the territory of this locale.

See Also▲

See also https://(), https://(), https://(), https://()

[static] QString QLocale::countryToCode(QLocale::Country country)▲

This function is deprecated since 6.6. We strongly advise against using it in new code.

Use https://() instead.

Returns the two-letter territory code for country, as defined in the ISO 3166 standard.

For QLocale::AnyTerritory or QLocale::AnyCountry an empty string is returned.

See Also▲

See also https://(), https://(), https://(), https://(), https://(), https://()

[static] QString QLocale::countryToString(QLocale::Country country)▲

This function is deprecated since 6.6. We strongly advise against using it in new code.

Use https://() instead.

Returns a https:// containing the name of country.

See Also▲

See also https://(), https://(), https://(), https://()

QString QLocale::nativeCountryName() const▲

This function is deprecated since 6.6. We strongly advise against using it in new code.

Use https://() instead.

Returns a native name of the territory for the locale. For example "España" for Spanish/Spain locale.

See Also▲

See also https://(), https://()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.