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