Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qlocale.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \class QLocale
6 \inmodule QtCore
7 \brief The QLocale class converts between numbers and their
8 string representations in various languages.
9
10 \reentrant
11 \ingroup i18n
12 \ingroup string-processing
13 \ingroup shared
14
15 QLocale is constructed for a specified language, optional script and
16 territory. It offers various facilities for formatting data as text,
17 localized appropriately, and for reading data out of localized text.
18
19 Example:
20
21 \snippet code/src_corelib_text_qlocale.cpp 0
22
23 QLocale supports the concept of a default locale, which is
24 determined from the system's locale settings at application
25 startup. The default locale can be changed by calling the
26 static member setDefault(). Setting the default locale has the
27 following effects:
28
29 \list
30 \li If a QLocale object is constructed with the default constructor,
31 it will use the default locale's settings.
32 \li QString::arg() uses the default locale to format a number when
33 its position specifier in the format string contains an 'L',
34 e.g. "%L1".
35 \endlist
36
37 The following example illustrates how to use QLocale directly:
38
39 \snippet code/src_corelib_text_qlocale.cpp 1
40
41 An alternative method for constructing a QLocale object is by
42 specifying the locale name.
43
44 \snippet code/src_corelib_text_qlocale.cpp 2
45
46 This constructor reads the language, script and/or territory from the given
47 name, accepting either uderscore or dash as separator (and ignoring any
48 trailing \c{.codeset} or \c{@variant} suffix).
49
50 \note For the current keyboard input locale take a look at
51 QInputMethod::locale().
52
53 QLocale's data is based on Common Locale Data Repository v42.
54
55 \section1 Matching combinations of language, script and territory
56
57 QLocale has data, derived from CLDR, for many combinations of language,
58 script and territory, but not all. If it is constructed with all three of
59 these key values specified (treating \c AnyLanguage, \c AnyScript or \c
60 AnyTerritory as unspecified) and QLocale has data for the given combination,
61 this data is used. Otherwise, QLocale does its best to find a sensible
62 combination of language, script and territory, for which it does have data,
63 that matches those that were specified.
64
65 The CLDR provides tables of likely combinations, which are used to fill in
66 any unspecified key or keys; if QLocale has data for the result of such a
67 likely combination, that is used. If no language is specified, and none can
68 be determined from script and territory, or if QLocale has no data for the
69 language, the "C" locale (when reading the keys from a string) or default
70 locale (otherwise) is used.
71
72 When QLocale has no data for the keys specified, with likely keys filled in
73 where unspecified, but does have data for the resulting language, a
74 fall-back is sought, based on ignoring either territory, script or both (in
75 that order). This results in a QLocale which may not match what was asked
76 for, but provides localization that's as suitable as the available data
77 permits, for the keys specified.
78
79 Use language(), script() and territory() to determine the actual keys used.
80
81 \sa QString::arg(), QInputMethod::locale()
82*/
83
84/*!
85 \enum QLocale::Language
86
87 This enumerated type is used to specify a language.
88
89 \value AnyLanguage
90 \value C A simplified English locale; see QLocale::c()
91
92 \value Abkhazian
93 \value Afan Obsolete, please use Oromo
94 \value Afar
95 \value Afrikaans
96 \value Aghem
97 \value Akan
98 \value [since 5.1] Akkadian
99 \value [since 5.3] Akoose
100 \value Albanian
101 \value [since 5.7] AmericanSignLanguage
102 \value Amharic
103 \value [since 5.1] AncientEgyptian
104 \value [since 5.1] AncientGreek
105 \value Arabic
106 \value [since 5.1] Aragonese
107 \value [since 5.1] Aramaic
108 \value Armenian
109 \value Assamese
110 \value Asturian
111 \value Asu
112 \value Atsam
113 \value Avaric
114 \value Avestan
115 \value Aymara
116 \value Azerbaijani
117 \value Bafia
118 \value [since 5.1] Balinese
119 \value Bambara
120 \value [since 5.1] Bamun
121 \value [since 6.0] Bangla
122 \value Basaa
123 \value Bashkir
124 \value Basque
125 \value [since 5.1] BatakToba
126 \value Belarusian
127 \value Bemba
128 \value Bena
129 \value Bengali Obsolete, please use Bangla
130 \value [since 5.7] Bhojpuri
131 \value Bhutani Obsolete, please use Dzongkha
132 \value Bislama
133 \value Blin
134 \value Bodo
135 \value Bosnian
136 \value Breton
137 \value [since 5.1] Buginese
138 \value Bulgarian
139 \value Burmese
140 \value Byelorussian Obsolete, please use Belarusian
141 \value Cambodian Obsolete, please use Khmer
142 \value [since 5.7] Cantonese
143 \value Catalan
144 \value [since 5.14] Cebuano
145 \value [since 6.0] CentralAtlasTamazight
146 \value [since 5.5] CentralKurdish
147 \value CentralMoroccoTamazight Obsolete, please use CentralAtlasTamazight
148 \value [since 5.1] Chakma
149 \value Chamorro
150 \value Chechen
151 \value Cherokee
152 \value Chewa Obsolete, please use Nyanja
153 \value [since 5.14] Chickasaw
154 \value Chiga
155 \value Chinese (Mandarin)
156 \value Church
157 \value Chuvash
158 \value Colognian
159 \value [since 5.1] Coptic
160 \value Cornish
161 \value Corsican
162 \value Cree
163 \value Croatian
164 \value Czech
165 \value Danish
166 \value Divehi
167 \value [since 5.1] Dogri
168 \value Duala
169 \value Dutch
170 \value Dzongkha
171 \value Embu
172 \value English
173 \value [since 5.14] Erzya
174 \value Esperanto
175 \value Estonian
176 \value Ewe
177 \value Ewondo
178 \value Faroese
179 \value Fijian
180 \value Filipino
181 \value Finnish
182 \value French
183 \value Frisian same as WesternFrisian
184 \value Friulian
185 \value Fulah
186 \value Ga
187 \value Gaelic
188 \value Galician
189 \value Ganda
190 \value Geez
191 \value Georgian
192 \value German
193 \value [since 5.1] Gothic
194 \value Greek
195 \value Greenlandic Obsolete, please use Kalaallisut
196 \value Guarani
197 \value Gujarati
198 \value Gusii
199 \value Haitian
200 \value [since 6.5] Haryanvi
201 \value Hausa
202 \value Hawaiian
203 \value Hebrew
204 \value Herero
205 \value Hindi
206 \value HiriMotu
207 \value Hungarian
208 \value Icelandic
209 \value [since 5.12] Ido
210 \value Igbo
211 \value [since 5.5] InariSami
212 \value Indonesian
213 \value [since 5.1] Ingush
214 \value Interlingua
215 \value Interlingue
216 \value Inuktitut
217 \value Inupiak Obsolete, please use Inupiaq
218 \value [since 6.0] Inupiaq
219 \value Irish
220 \value Italian
221 \value Japanese
222 \value Javanese
223 \value Jju
224 \value JolaFonyi
225 \value Kabuverdianu
226 \value Kabyle
227 \value [since 6.3] Kaingang
228 \value Kako
229 \value [since 6.0] Kalaallisut
230 \value Kalenjin
231 \value Kamba
232 \value Kannada
233 \value Kanuri
234 \value Kashmiri
235 \value Kazakh
236 \value [since 5.5] Kenyang
237 \value Khmer
238 \value [since 5.5] Kiche
239 \value Kikuyu
240 \value Kinyarwanda
241 \value Kirghiz Obsolete, please use Kyrgyz
242 \value Komi
243 \value Kongo
244 \value Konkani
245 \value Korean
246 \value Koro
247 \value KoyraboroSenni
248 \value KoyraChiini
249 \value Kpelle
250 \value [since 6.0] Kuanyama
251 \value Kurdish
252 \value Kurundi Obsolete, please use Rundi
253 \value Kwanyama Obsolete, please use Kuanyama
254 \value Kwasio
255 \value [since 6.0] Kyrgyz
256 \value [since 5.3] Lakota
257 \value Langi
258 \value Lao
259 \value Latin
260 \value Latvian
261 \value [since 5.5] Lezghian
262 \value Limburgish
263 \value Lingala
264 \value [since 5.7] LiteraryChinese
265 \value Lithuanian
266 \value [since 5.12] Lojban
267 \value [since 5.5] LowerSorbian
268 \value LowGerman
269 \value LubaKatanga
270 \value [since 5.5] LuleSami
271 \value Luo
272 \value Luxembourgish
273 \value Luyia
274 \value Macedonian
275 \value Machame
276 \value [since 5.5] Maithili
277 \value MakhuwaMeetto
278 \value Makonde
279 \value Malagasy
280 \value Malay
281 \value Malayalam
282 \value Maltese
283 \value [since 5.1] Mandingo
284 \value [since 5.1] Manipuri
285 \value Manx
286 \value Maori
287 \value [since 5.5] Mapuche
288 \value Marathi
289 \value Marshallese
290 \value Masai
291 \value [since 5.7] Mazanderani
292 \value [since 5.5] Mende
293 \value Meru
294 \value Meta
295 \value [since 5.5] Mohawk
296 \value [since 6.5] Moksha
297 \value Mongolian
298 \value Morisyen
299 \value Mundang
300 \value [since 5.14] Muscogee
301 \value Nama
302 \value NauruLanguage
303 \value Navaho Obsolete, please use Navajo
304 \value [since 6.0] Navajo
305 \value Ndonga
306 \value Nepali
307 \value [since 5.7] Newari
308 \value Ngiemboon
309 \value [since 6.3] Nheengatu
310 \value [since 6.0] NigerianPidgin
311 \value Ngomba
312 \value [since 5.5] Nko
313 \value [since 6.5] NorthernFrisian
314 \value [since 5.7] NorthernLuri
315 \value NorthernSami
316 \value NorthernSotho
317 \value NorthNdebele
318 \value NorwegianBokmal
319 \value NorwegianNynorsk
320 \value Nuer
321 \value Nyanja
322 \value Nyankole
323 \value [since 6.5] Obolo
324 \value Occitan
325 \value [since 6.0] Odia
326 \value Ojibwa
327 \value [since 5.1] OldIrish
328 \value [since 5.1] OldNorse
329 \value [since 5.1] OldPersian
330 \value Oriya Obsolete, please use Odia
331 \value Oromo
332 \value [since 5.7] Osage
333 \value Ossetic
334 \value [since 5.1] Pahlavi
335 \value [since 5.7] Palauan
336 \value Pali
337 \value [since 5.7] Papiamento
338 \value Pashto
339 \value Persian
340 \value [since 5.1] Phoenician
341 \value [since 6.5] Pijin
342 \value Polish
343 \value Portuguese
344 \value [since 5.5] Prussian
345 \value Punjabi
346 \value Quechua
347 \value [since 6.5] Rajasthani
348 \value RhaetoRomance Obsolete, please use Romansh
349 \value Romanian
350 \value Romansh
351 \value Rombo
352 \value Rundi
353 \value Russian
354 \value Rwa
355 \value Saho
356 \value Sakha
357 \value Samburu
358 \value Samoan
359 \value Sango
360 \value Sangu
361 \value Sanskrit
362 \value [since 5.1] Santali
363 \value Sardinian
364 \value [since 5.1] Saurashtra
365 \value Sena
366 \value Serbian
367 \value Shambala
368 \value Shona
369 \value SichuanYi
370 \value [since 5.12] Sicilian
371 \value Sidamo
372 \value [since 5.14] Silesian
373 \value Sindhi
374 \value Sinhala
375 \value [since 5.5] SkoltSami
376 \value Slovak
377 \value Slovenian
378 \value Soga
379 \value Somali
380 \value [since 5.12] SouthernKurdish
381 \value [since 5.5] SouthernSami
382 \value SouthernSotho
383 \value SouthNdebele
384 \value Spanish
385 \value [since 5.3] StandardMoroccanTamazight
386 \value Sundanese
387 \value Swahili
388 \value Swati
389 \value Swedish
390 \value SwissGerman
391 \value Syriac
392 \value Tachelhit
393 \value Tahitian
394 \value [since 5.1] TaiDam
395 \value Taita
396 \value Tajik
397 \value Tamil
398 \value Taroko
399 \value Tasawaq
400 \value Tatar
401 \value Telugu
402 \value Teso
403 \value Thai
404 \value Tibetan
405 \value Tigre
406 \value Tigrinya
407 \value [since 5.7] TokelauLanguage
408 \value [since 6.5] TokiPona
409 \value [since 5.7] TokPisin
410 \value Tongan
411 \value Tsonga
412 \value Tswana
413 \value Turkish
414 \value Turkmen
415 \value [since 5.7] TuvaluLanguage
416 \value Tyap
417 \value [since 5.1] Ugaritic
418 \value Uighur Obsolete, please use Uyghur
419 \value Uigur Obsolete, please use Uyghur
420 \value Ukrainian
421 \value [since 5.5] UpperSorbian
422 \value Urdu
423 \value [since 6.0] Uyghur
424 \value Uzbek
425 \value Vai
426 \value Venda
427 \value Vietnamese
428 \value Volapuk
429 \value Vunjo
430 \value Walamo Obsolete, please use Wolaytta
431 \value Walloon
432 \value Walser
433 \value [since 5.5] Warlpiri
434 \value Welsh
435 \value [since 5.12] WesternBalochi
436 \value WesternFrisian same as Frisian
437 \value [since 6.0] Wolaytta
438 \value Wolof
439 \value Xhosa
440 \value Yangben
441 \value Yiddish
442 \value Yoruba
443 \value Zarma
444 \value Zhuang
445 \value Zulu
446
447 \omitvalue LastLanguage
448
449 \sa language(), languageToString()
450*/
451
452/*!
453 \typealias QLocale::Territory
454
455 This enumeration type is an alias for \l Country,
456 which shall be renamed to Territory at a future release.
457
458 \sa territory(), territoryToString()
459*/
460
461/*!
462 \enum QLocale::Country
463
464 This enumerated type is used to identify a territory.
465
466 An individual territory may be a province of a country, a country (by far the
467 most common case) or a larger geographic entity, to which some localization
468 details are specific.
469
470 \value AnyCountry Osbolete alias for \c AnyTerritory
471 \value [since 6.2] AnyTerritory
472
473 \value Afghanistan
474 \value AlandIslands
475 \value Albania
476 \value Algeria
477 \value AmericanSamoa
478 \value Andorra
479 \value Angola
480 \value Anguilla
481 \value Antarctica
482 \value AntiguaAndBarbuda
483 \value Argentina
484 \value Armenia
485 \value Aruba
486 \value AscensionIsland
487 \value Australia
488 \value Austria
489 \value Azerbaijan
490 \value Bahamas
491 \value Bahrain
492 \value Bangladesh
493 \value Barbados
494 \value Belarus
495 \value Belgium
496 \value Belize
497 \value Benin
498 \value Bermuda
499 \value Bhutan
500 \value Bolivia
501 \value Bonaire
502 \value BosniaAndHerzegowina Obsolete, use \c BosniaAndHerzegovina instead
503 \value [since 6.0] BosniaAndHerzegovina
504 \value Botswana
505 \value BouvetIsland
506 \value Brazil
507 \value BritishIndianOceanTerritory
508 \value BritishVirginIslands
509 \value Brunei
510 \value Bulgaria
511 \value BurkinaFaso
512 \value Burundi
513 \value Cambodia
514 \value Cameroon
515 \value Canada
516 \value CanaryIslands
517 \value CaribbeanNetherlands
518 \value CapeVerde
519 \value CaymanIslands
520 \value CentralAfricanRepublic
521 \value CeutaAndMelilla
522 \value Chad
523 \value Chile
524 \value China
525 \value ChristmasIsland
526 \value ClippertonIsland
527 \value CocosIslands
528 \value Colombia
529 \value Comoros
530 \value CongoBrazzaville
531 \value CongoKinshasa
532 \value CookIslands
533 \value CostaRica
534 \value Croatia
535 \value Cuba
536 \value [since 6.0] Curacao
537 \value CuraSao Obsolete, use \c Curacao instead
538 \value Cyprus
539 \value [since 6.0] Czechia
540 \value CzechRepublic Obsolete, use \c Czechia instead
541 \value DemocraticRepublicOfCongo Obsolete, use \c CongoKinshasa instead
542 \value DemocraticRepublicOfKorea Obsolete, use \c NorthKorea instead
543 \value Denmark
544 \value DiegoGarcia
545 \value Djibouti
546 \value Dominica
547 \value DominicanRepublic
548 \value EastTimor
549 \value Ecuador
550 \value Egypt
551 \value ElSalvador
552 \value EquatorialGuinea
553 \value Eritrea
554 \value Estonia
555 \value Eswatini
556 \value Ethiopia
557 \value [since 5.7] EuropeanUnion
558 \value [since 5.12] Europe
559 \value FalklandIslands
560 \value FaroeIslands
561 \value Fiji
562 \value Finland
563 \value France
564 \value FrenchGuiana
565 \value FrenchPolynesia
566 \value FrenchSouthernTerritories
567 \value Gabon
568 \value Gambia
569 \value Georgia
570 \value Germany
571 \value Ghana
572 \value Gibraltar
573 \value Greece
574 \value Greenland
575 \value Grenada
576 \value Guadeloupe
577 \value Guam
578 \value Guatemala
579 \value Guernsey
580 \value Guinea
581 \value GuineaBissau
582 \value Guyana
583 \value Haiti
584 \value HeardAndMcDonaldIslands
585 \value Honduras
586 \value HongKong
587 \value Hungary
588 \value Iceland
589 \value India
590 \value Indonesia
591 \value Iran
592 \value Iraq
593 \value Ireland
594 \value IsleOfMan
595 \value Israel
596 \value Italy
597 \value IvoryCoast
598 \value Jamaica
599 \value Japan
600 \value Jersey
601 \value Jordan
602 \value Kazakhstan
603 \value Kenya
604 \value Kiribati
605 \value [since 5.2] Kosovo
606 \value Kuwait
607 \value Kyrgyzstan
608 \value Laos
609 \value LatinAmerica
610 \value LatinAmericaAndTheCaribbean Obsolete, use \c LatinAmerica instead
611 \value Latvia
612 \value Lebanon
613 \value Lesotho
614 \value Liberia
615 \value Libya
616 \value Liechtenstein
617 \value Lithuania
618 \value Luxembourg
619 \value Macao
620 \value Macau
621 \value Macedonia
622 \value Madagascar
623 \value Malawi
624 \value Malaysia
625 \value Maldives
626 \value Mali
627 \value Malta
628 \value MarshallIslands
629 \value Martinique
630 \value Mauritania
631 \value Mauritius
632 \value Mayotte
633 \value Mexico
634 \value Micronesia
635 \value Moldova
636 \value Monaco
637 \value Mongolia
638 \value Montenegro
639 \value Montserrat
640 \value Morocco
641 \value Mozambique
642 \value Myanmar
643 \value Namibia
644 \value NauruCountry Osbolete alias for \c NauruTerritory
645 \value [since 6.2] NauruTerritory
646 \value Nepal
647 \value Netherlands
648 \value NewCaledonia
649 \value NewZealand
650 \value Nicaragua
651 \value Niger
652 \value Nigeria
653 \value Niue
654 \value NorfolkIsland
655 \value NorthernMarianaIslands
656 \value NorthKorea
657 \value Norway
658 \value Oman
659 \value [since 5.7] OutlyingOceania
660 \value Pakistan
661 \value Palau
662 \value PalestinianTerritories
663 \value Panama
664 \value PapuaNewGuinea
665 \value Paraguay
666 \value PeoplesRepublicOfCongo Obsolete, use \c CongoBrazzaville instead
667 \value Peru
668 \value Philippines
669 \value Pitcairn
670 \value Poland
671 \value Portugal
672 \value PuertoRico
673 \value Qatar
674 \value RepublicOfKorea Obsolete, use \c SouthKorea instead
675 \value Reunion
676 \value Romania
677 \value RussianFederation
678 \value Russia
679 \value Rwanda
680 \value SaintBarthelemy
681 \value SaintHelena
682 \value SaintKittsAndNevis
683 \value SaintLucia
684 \value SaintMartin
685 \value SaintPierreAndMiquelon
686 \value SaintVincentAndGrenadines
687 \value SaintVincentAndTheGrenadines
688 \value Samoa
689 \value SanMarino
690 \value SaoTomeAndPrincipe
691 \value SaudiArabia
692 \value Senegal
693 \value Serbia
694 \value Seychelles
695 \value SierraLeone
696 \value Singapore
697 \value SintMaarten
698 \value Slovakia
699 \value Slovenia
700 \value SolomonIslands
701 \value Somalia
702 \value SouthAfrica
703 \value SouthGeorgiaAndSouthSandwichIslands
704 \value SouthGeorgiaAndTheSouthSandwichIslands
705 \value SouthKorea
706 \value SouthSudan
707 \value Spain
708 \value SriLanka
709 \value Sudan
710 \value Suriname
711 \value SvalbardAndJanMayen
712 \value SvalbardAndJanMayenIslands
713 \value Swaziland
714 \value Sweden
715 \value Switzerland
716 \value Syria
717 \value SyrianArabRepublic Obsolete, use \c Syria instead
718 \value Taiwan
719 \value Tajikistan
720 \value Tanzania
721 \value Thailand
722 \value TimorLeste
723 \value Togo
724 \value TokelauCountry Osbolete alias for \c TokelauTerritory
725 \value [since 6.2] TokelauTerritory
726 \value Tonga
727 \value TrinidadAndTobago
728 \value TristanDaCunha
729 \value Tunisia
730 \value Turkey
731 \value Turkmenistan
732 \value TurksAndCaicosIslands
733 \value TuvaluCountry Osbolete alias for \c TuvaluTerritory
734 \value [since 6.2] TuvaluTerritory
735 \value Uganda
736 \value Ukraine
737 \value UnitedArabEmirates
738 \value UnitedKingdom
739 \value UnitedStates
740 \value UnitedStatesOutlyingIslands
741 \value UnitedStatesMinorOutlyingIslands
742 \value UnitedStatesVirginIslands
743 \value Uruguay
744 \value Uzbekistan
745 \value Vanuatu
746 \value VaticanCity
747 \value VaticanCityState
748 \value Venezuela
749 \value Vietnam
750 \value WallisAndFutuna
751 \value WallisAndFutunaIslands
752 \value WesternSahara
753 \value [since 5.12] World
754 \value Yemen
755 \value Zambia
756 \value Zimbabwe
757
758 \omitvalue LastCountry Osbolete alias for \c LastTerritory
759 \omitvalue LastTerritory
760
761 \note Use the Territory alias for this enumeration where possible.
762 The Country enum shall be renamed to Territory at a later release.
763
764 \sa territory(), territoryToString(), codeToTerritory(), territoryToCode()
765*/
766
767/*!
768 \enum QLocale::Script
769
770 This enumerated type is used to specify a script.
771
772 \value AnyScript
773
774 \value [since 5.7] AdlamScript
775 \value [since 5.7] AhomScript
776 \value [since 5.7] AnatolianHieroglyphsScript
777 \value ArabicScript
778 \value ArmenianScript
779 \value [since 5.1] AvestanScript
780 \value [since 5.1] BalineseScript
781 \value [since 5.1] BamumScript
782 \value [since 6.0] BanglaScript
783 \value [since 5.5] BassaVahScript
784 \value [since 5.1] BatakScript
785 \value BengaliScript Obsolete, please use BanglaScript
786 \value [since 5.7] BhaiksukiScript
787 \value [since 5.1] BopomofoScript
788 \value [since 5.1] BrahmiScript
789 \value [since 5.1] BrailleScript
790 \value [since 5.1] BugineseScript
791 \value [since 5.1] BuhidScript
792 \value [since 5.1] CanadianAboriginalScript
793 \value [since 5.1] CarianScript
794 \value [since 5.5] CaucasianAlbanianScript
795 \value [since 5.1] ChakmaScript
796 \value [since 5.1] ChamScript
797 \value CherokeeScript
798 \value [since 5.1] CopticScript
799 \value [since 5.1] CuneiformScript
800 \value [since 5.1] CypriotScript
801 \value CyrillicScript
802 \value [since 5.1] DeseretScript
803 \value DevanagariScript
804 \value [since 5.5] DuployanScript
805 \value [since 5.1] EgyptianHieroglyphsScript
806 \value [since 5.5] ElbasanScript
807 \value EthiopicScript
808 \value [since 5.1] FraserScript
809 \value GeorgianScript
810 \value [since 5.1] GlagoliticScript
811 \value [since 5.1] GothicScript
812 \value [since 5.5] GranthaScript
813 \value GreekScript
814 \value GujaratiScript
815 \value GurmukhiScript
816 \value [since 5.1] HangulScript
817 \value [since 5.1] HanScript
818 \value [since 5.1] HanunooScript
819 \value [since 5.7] HanWithBopomofoScript
820 \value [since 5.7] HatranScript
821 \value HebrewScript
822 \value [since 5.1] HiraganaScript
823 \value [since 5.1] ImperialAramaicScript
824 \value [since 5.1] InscriptionalPahlaviScript
825 \value [since 5.1] InscriptionalParthianScript
826 \value [since 5.7] JamoScript
827 \value JapaneseScript
828 \value [since 5.1] JavaneseScript
829 \value [since 5.1] KaithiScript
830 \value KannadaScript
831 \value [since 5.1] KatakanaScript
832 \value [since 5.1] KayahLiScript
833 \value [since 5.1] KharoshthiScript
834 \value [since 5.1] KhmerScript
835 \value [since 5.5] KhojkiScript
836 \value [since 5.5] KhudawadiScript
837 \value KoreanScript
838 \value [since 5.1] LannaScript
839 \value LaoScript
840 \value LatinScript
841 \value [since 5.1] LepchaScript
842 \value [since 5.1] LimbuScript
843 \value [since 5.5] LinearAScript
844 \value [since 5.1] LinearBScript
845 \value [since 5.1] LycianScript
846 \value [since 5.1] LydianScript
847 \value [since 5.5] MahajaniScript
848 \value MalayalamScript
849 \value [since 5.1] MandaeanScript
850 \value [since 5.5] ManichaeanScript
851 \value [since 5.7] MarchenScript
852 \value [since 5.1] MeiteiMayekScript
853 \value [since 6.0] MendeScript
854 \value MendeKikakuiScript Obsolete, please use MendeScript
855 \value [since 5.1] MeroiticCursiveScript
856 \value [since 5.1] MeroiticScript
857 \value [since 5.5] ModiScript
858 \value MongolianScript
859 \value [since 5.5] MroScript
860 \value [since 5.7] MultaniScript
861 \value MyanmarScript
862 \value [since 5.5] NabataeanScript
863 \value [since 5.7] NewaScript
864 \value [since 5.1] NewTaiLueScript
865 \value [since 5.1] NkoScript
866 \value [since 5.1] OghamScript
867 \value [since 5.1] OlChikiScript
868 \value [since 5.7] OldHungarianScript
869 \value [since 5.1] OldItalicScript
870 \value [since 5.5] OldNorthArabianScript
871 \value [since 5.5] OldPermicScript
872 \value [since 5.1] OldPersianScript
873 \value [since 5.1] OldSouthArabianScript
874 \value [since 6.0] OdiaScript
875 \value OriyaScript Obsolete, please use OdiaScript
876 \value [since 5.1] OrkhonScript
877 \value [since 5.7] OsageScript
878 \value [since 5.1] OsmanyaScript
879 \value [since 5.5] PahawhHmongScript
880 \value [since 5.5] PalmyreneScript
881 \value [since 5.5] PauCinHauScript
882 \value [since 5.1] PhagsPaScript
883 \value [since 5.1] PhoenicianScript
884 \value [since 5.1] PollardPhoneticScript
885 \value [since 5.5] PsalterPahlaviScript
886 \value [since 5.1] RejangScript
887 \value [since 5.1] RunicScript
888 \value [since 5.1] SamaritanScript
889 \value [since 5.1] SaurashtraScript
890 \value [since 5.1] SharadaScript
891 \value [since 5.1] ShavianScript
892 \value [since 5.5] SiddhamScript
893 \value [since 5.7] SignWritingScript
894 \value SimplifiedChineseScript same as SimplifiedHanScript
895 \value SimplifiedHanScript same as SimplifiedChineseScript
896 \value SinhalaScript
897 \value [since 5.1] SoraSompengScript
898 \value [since 5.1] SundaneseScript
899 \value [since 5.1] SylotiNagriScript
900 \value SyriacScript
901 \value [since 5.1] TagalogScript
902 \value [since 5.1] TagbanwaScript
903 \value [since 5.1] TaiLeScript
904 \value [since 5.1] TaiVietScript
905 \value [since 5.1] TakriScript
906 \value TamilScript
907 \value [since 5.7] TangutScript
908 \value TeluguScript
909 \value ThaanaScript
910 \value ThaiScript
911 \value TibetanScript
912 \value TifinaghScript
913 \value [since 5.5] TirhutaScript
914 \value TraditionalChineseScript same as TraditionalHanScript
915 \value TraditionalHanScript same as TraditionalChineseScript
916 \value [since 5.1] UgariticScript
917 \value VaiScript
918 \value [since 5.5] VarangKshitiScript
919 \value YiScript
920
921 \omitvalue LastScript
922
923 \sa script(), scriptToString(), languageToString()
924*/
925
926/*!
927 \enum QLocale::FormatType
928
929 This enum describes the different formats that can be used when
930 converting QDate, QTime, and QDateTime objects, as well
931 as months and days, to strings specific to the locale.
932
933 \value LongFormat Longer format.
934
935 \value ShortFormat Shorter format.
936
937 \value NarrowFormat A special version for use when space is very limited.
938
939 \note \c NarrowFormat might contain the same text for
940 different months and days. It can even be an empty string if the
941 locale doesn't support narrow names, so you should avoid using it
942 for date formatting. Also, for the system locale this format is
943 the same as \c ShortFormat.
944
945 \sa dateFormat(), timeFormat(), dateTimeFormat()
946 \sa monthName(), standaloneMonthName(), dayName(), standaloneDayName()
947 \sa toDate(), toTime(), toDateTime()
948*/
949
950/*!
951 \enum QLocale::NumberOption
952
953 This enum defines a set of options for number-to-string and string-to-number
954 conversions. They can be retrieved with numberOptions() and set with
955 setNumberOptions().
956
957 \value DefaultNumberOptions This option represents the default behavior, with
958 group separators, with one leading zero in single digit exponents, and
959 without trailing zeroes after the decimal dot.
960 \value OmitGroupSeparator If this option is set, the number-to-string functions
961 will not insert group separators in their return values. The default
962 is to insert group separators.
963 \value RejectGroupSeparator If this option is set, the string-to-number functions
964 will fail if they encounter group separators in their input. The default
965 is to accept numbers containing correctly placed group separators.
966 \value OmitLeadingZeroInExponent If this option is set, the number-to-string
967 functions will not pad exponents with zeroes when printing floating point
968 numbers in scientific notation. The default is to add one leading zero to
969 single digit exponents.
970 \value RejectLeadingZeroInExponent If this option is set, the string-to-number
971 functions will fail if they encounter an exponent padded with zeroes when
972 parsing a floating point number in scientific notation. The default is to
973 accept such padding.
974 \value IncludeTrailingZeroesAfterDot If this option is set, the number-to-string
975 functions will pad numbers with zeroes to the requested precision in "g"
976 or "most concise" mode, even if the number of significant digits is lower
977 than the requested precision. The default is to omit trailing zeroes.
978 \value RejectTrailingZeroesAfterDot If this option is set, the string-to-number
979 functions will fail if they encounter trailing zeroes after the decimal
980 dot when parsing a number in scientific or decimal representation. The
981 default is to accept trailing zeroes.
982
983 \sa setNumberOptions(), numberOptions(), FloatingPointPrecisionOption
984*/
985
986/*!
987 \enum QLocale::FloatingPointPrecisionOption
988
989 This enum defines a constant that can be given as precision to QString::number(),
990 QByteArray::number(), and QLocale::toString() when converting floats or doubles,
991 in order to express a variable number of digits as precision.
992
993 \value FloatingPointShortest The conversion algorithm will try to find the
994 shortest accurate representation for the given number. "Accurate" means
995 that you get the exact same number back from an inverse conversion on
996 the generated string representation. In particular, trailing zeros are
997 omitted (from the mantissa, in exponent formats).
998
999 \sa toString(), QString::number(), QByteArray::number()
1000 \since 5.7
1001*/
1002
1003/*!
1004 \enum QLocale::MeasurementSystem
1005
1006 This enum defines which units are used for measurement.
1007
1008 \value MetricSystem This value indicates metric units, such as meters,
1009 centimeters and millimeters.
1010 \value ImperialUSSystem This value indicates imperial units, such as inches and
1011 miles as they are used in the United States.
1012 \value ImperialUKSystem This value indicates imperial units, such as inches and
1013 miles as they are used in the United Kingdom.
1014 \value ImperialSystem Provided for compatibility. Same as ImperialUSSystem
1015
1016 \since 4.4
1017*/
1018
1019/*!
1020 \enum QLocale::LanguageCodeType
1021
1022 This enum defines language code types that can be used to restrict set
1023 of language codes considered by \c codeToLanguage and \c languageToCode.
1024
1025 \value ISO639Part1 ISO 639 Part 1 Alpha 2 code.
1026 \value ISO639Part2B ISO 639 Part 2 bibliographic Alpha 3 code.
1027 \value ISO639Part2T ISO 639 Part 2 terminological Alpha 3 code.
1028 \value ISO639Part3 ISO 639 Part 3 Alpha 3 code.
1029 \value LegacyLanguageCode Codes that are not part of the above set, but that
1030 were supported by Qt in the past. This value can only be used by
1031 codeToLanguage(). It is ignored when passed to languageToCode().
1032 \value ISO639Part2 Any ISO 639 Part 2 code.
1033 \value ISO639Alpha2 Any ISO-639 2-letter code.
1034 \value ISO639Alpha3 Any ISO-639 3-letter code.
1035 \value ISO639 Any ISO 639 code.
1036 \value AnyLanguageCode Specifies that any code can be used.
1037*/
1038
1039/*!
1040 \fn bool QLocale::operator==(const QLocale &lhs, const QLocale &rhs)
1041
1042 Returns \c true if the two QLocale objects, \a lhs and \a rhs, are the same;
1043 otherwise returns \c false.
1044
1045 \note The system locale is not equal to the QLocale object constructed from
1046 its language(), script() and territory(), even if the two agree in all data
1047 fields. Nor are two locales with different number options equal.
1048
1049 \sa operator!=(), setNumberOptions()
1050*/
1051
1052/*!
1053 \fn bool QLocale::operator!=(const QLocale &lhs, const QLocale &rhs)
1054
1055 Returns \c true if the two QLocale objects, \a lhs and \a rhs, differ;
1056 otherwise returns \c false.
1057
1058 \note The system locale is not equal to the QLocale object constructed from
1059 its language(), script() and territory(), even if the two agree in all data
1060 fields. Nor are two locales with different number options equal.
1061
1062 \sa operator==(), setNumberOptions()
1063*/
1064
1065/*!
1066 \enum QLocale::QuotationStyle
1067
1068 This enum defines a set of possible styles for locale specific quotation.
1069
1070 \value StandardQuotation If this option is set, the standard quotation marks
1071 will be used to quote strings.
1072 \value AlternateQuotation If this option is set, the alternate quotation marks
1073 will be used to quote strings.
1074
1075 \since 4.8
1076
1077 \sa quoteString()
1078*/
1079
1080/*!
1081 \internal
1082 \class QSystemLocale
1083 \inmodule QtCore
1084 \brief The QSystemLocale class can be used to finetune the system locale
1085 of the user.
1086 \since 4.2
1087
1088 \ingroup i18n
1089
1090 \warning This class is only useful in very rare cases. Usually QLocale offers
1091 all the functionality required for application development.
1092
1093 QSystemLocale allows to override the values provided by the system
1094 locale (QLocale::system()).
1095
1096 \sa QLocale
1097*/
1098
1099/*!
1100 \enum QSystemLocale::QueryType
1101
1102 Specifies the type of information queried by query(). For each value
1103 the type of information to return from the query() method is listed.
1104
1105 \value LanguageId a uint specifying the language.
1106 \value ScriptId a uint specifying the script.
1107 \value TerritoryId a uint specifying the territory.
1108 \value DecimalPoint a QString specifying the decimal point.
1109 \value GroupSeparator a QString specifying the group separator.
1110 \value ZeroDigit a QString specifying the zero digit.
1111 \value NegativeSign a QString specifying the minus sign.
1112 \value PositiveSign a QString specifying the plus sign.
1113 \value DateFormatLong a QString specifying the long date format
1114 \value DateFormatShort a QString specifying the short date format
1115 \value TimeFormatLong a QString specifying the long time format
1116 \value TimeFormatShort a QString specifying the short time format
1117 \value DayNameLong a QString specifying the name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
1118 \value DayNameShort a QString specifying the short name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
1119 \value MonthNameLong a QString specifying the name of a month. the in variant contains an integer between 1 and 12
1120 \value MonthNameShort a QString specifying the short name of a month. the in variant contains an integer between 1 and 12
1121 \value DateToStringLong converts the QDate stored in the in variant to a QString using the long date format
1122 \value DateToStringShort converts the QDate stored in the in variant to a QString using the short date format
1123 \value TimeToStringLong converts the QTime stored in the in variant to a QString using the long time format
1124 \value TimeToStringShort converts the QTime stored in the in variant to a QString using the short time format
1125 \value DateTimeFormatLong a QString specifying the long date time format
1126 \value DateTimeFormatShort a QString specifying the short date time format
1127 \value DateTimeToStringLong converts the QDateTime in the in variant to a QString using the long datetime format
1128 \value DateTimeToStringShort converts the QDateTime in the in variant to a QString using the short datetime format
1129 \value MeasurementSystem a QLocale::MeasurementSystem enum specifying the measurement system
1130 \value AMText a string that represents the system AM designator associated with a 12-hour clock.
1131 \value PMText a string that represents the system PM designator associated with a 12-hour clock.
1132 \value FirstDayOfWeek a Qt::DayOfWeek enum specifying the first day of the week
1133 \value CurrencySymbol a string that represents a currency in a format QLocale::CurrencyFormat.
1134 \value CurrencyToString a localized string representation of a number with a currency symbol. Converts a QSystemLocale::CurrencyToStringArgument stored in the in variant to a QString.
1135 \value UILanguages a list of strings representing locale names that could be used for UI translation.
1136 \value StringToStandardQuotation a QString containing a quoted version of the string ref stored in the in variant using standard quotes.
1137 \value StringToAlternateQuotation a QString containing a quoted version of the string ref stored in the in variant using alternate quotes.
1138 \value Weekdays a QList<Qt::DayOfWeek> specifying the regular weekdays
1139 \value LocaleChanged this type is queried whenever the system locale is changed.
1140 \value ListToSeparatedString a string that represents a join of a given QStringList with a locale-defined separator.
1141 \value NativeLanguageName a string that represents the name of the native language.
1142 \value NativeTerritoryName a string that represents the name of the native territory.
1143
1144 \sa FormatType
1145*/
1146
1147/*!
1148 \fn QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
1149
1150 Generic query method for locale data. Provides indirection.
1151 Denotes the \a type of the query
1152 with \a in as input data depending on the query.
1153
1154 \sa QSystemLocale::QueryType
1155*/
1156
1157/*!
1158 \fn QLocale QSystemLocale::fallbackLocale() const
1159
1160 \since 4.6
1161
1162 Returns the locale used if the system locale is not able to answer a query.
1163
1164 Must be a QLocale instance based on the built-in CLDR data, and should
1165 match what the system locale is using as closely as that data supports.
1166*/
1167
1168/*!
1169 \class QSystemLocale::CurrencyToStringArgument
1170 \inmodule QtCore
1171
1172 A helper class that provides arguments for the QSystemLocale::query()
1173 function with query type QSystemLocale::CurrencyToString.
1174
1175 \sa QSystemLocale::QueryType
1176 \since 4.8
1177*/
1178
1179/*!
1180 \fn QSystemLocale::CurrencyToStringArgument::CurrencyToStringArgument()
1181 \internal
1182*/
1183/*!
1184 \variable QSystemLocale::CurrencyToStringArgument::value
1185
1186 An input value that should be converted to its string representation.
1187 Contains one of QMetaType::LongLong, QMetaType::ULongLong or QMetaType::Double
1188 types.
1189*/
1190/*!
1191 \variable QSystemLocale::CurrencyToStringArgument::symbol
1192
1193 An optional argument containing a currency symbol to be used in the
1194 currency string.
1195*/
1196
1197/*!
1198\fn QString QLocale::toString(long i) const
1199
1200\overload
1201
1202\sa toLong()
1203*/
1204
1205/*!
1206\fn QString QLocale::toString(ulong i) const
1207
1208\overload
1209
1210\sa toULong()
1211*/
1212
1213/*!
1214\fn QString QLocale::toString(ushort i) const
1215
1216\overload
1217
1218\sa toUShort()
1219*/
1220
1221
1222/*!
1223\fn QString QLocale::toString(short i) const
1224
1225\overload
1226
1227\sa toShort()
1228*/
1229
1230/*!
1231\fn QString QLocale::toString(int i) const
1232
1233\overload
1234
1235\sa toInt()
1236*/
1237
1238/*!
1239\fn QString QLocale::toString(uint i) const
1240
1241\overload
1242
1243\sa toUInt()
1244*/
1245
1246/*
1247\fn QString QLocale::toString(long i) const
1248
1249\overload
1250
1251\sa toLong()
1252*/
1253
1254/*
1255\fn QString QLocale::toString(ulong i) const
1256
1257\overload
1258
1259\sa toULong()
1260*/
1261
1262/*!
1263\fn QString QLocale::toString(float f, char format = 'g', int precision = 6) const
1264\overload
1265
1266Returns a string representing the floating-point number \a f.
1267
1268The \a format and \a precision have the same meanings as described in \l
1269{toString(double, char, int)}.
1270
1271\sa toFloat(), toDouble(), numberOptions(), exponential(), decimalPoint(), zeroDigit(),
1272 positiveSign(), percent(), toCurrencyString(), formattedDataSize(),
1273 QLocale::FloatingPointPrecisionOption
1274*/
1275
1276/*!
1277 \fn QString QLocale::toCurrencyString(short value, const QString &symbol) const
1278 \since 4.8
1279 \overload
1280*/
1281
1282/*!
1283 \fn QString QLocale::toCurrencyString(ushort value, const QString &symbol) const
1284 \since 4.8
1285 \overload
1286*/
1287
1288/*!
1289 \fn QString QLocale::toCurrencyString(int value, const QString &symbol) const
1290 \since 4.8
1291 \overload
1292*/
1293
1294/*!
1295 \fn QString QLocale::toCurrencyString(uint value, const QString &symbol) const
1296 \since 4.8
1297 \overload
1298*/