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 v47.
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 5.3] Lakota
280 \value Langi
281 \value Lao
282 \value Latin
283 \value Latvian
284 \value [since 5.5] Lezghian
285 \value Limburgish
286 \value Lingala
287 \value [since 6.6] Ligurian
288 \value [since 5.7] LiteraryChinese
289 \value Lithuanian
290 \value [since 5.12] Lojban
291 \value [since 5.5] LowerSorbian
292 \value LowGerman
293 \value LubaKatanga
294 \value [since 5.5] LuleSami
295 \value Luo
296 \value Luxembourgish
297 \value Luyia
298 \value Macedonian
299 \value Machame
300 \value [since 5.5] Maithili
301 \value MakhuwaMeetto
302 \value Makonde
303 \value Malagasy
304 \value Malay
305 \value Malayalam
306 \value Maltese
307 \value [since 5.1] Mandingo
308 \value [since 5.1] Manipuri
309 \value Manx
310 \value Maori
311 \value [since 5.5] Mapuche
312 \value Marathi
313 \value Marshallese
314 \value Masai
315 \value [since 5.7] Mazanderani
316 \value [since 5.5] Mende
317 \value Meru
318 \value Meta
319 \value [since 5.5] Mohawk
320 \value [since 6.5] Moksha
321 \value Mongolian
322 \value Morisyen
323 \value Mundang
324 \value [since 5.14] Muscogee
325 \value Nama
326 \value NauruLanguage
327 \value Navaho Obsolete, please use Navajo
328 \value [since 6.0] Navajo
329 \value Ndonga
330 \value Nepali
331 \value [since 5.7] Newari
332 \value Ngiemboon
333 \value [since 6.3] Nheengatu
334 \value [since 6.0] NigerianPidgin
335 \value Ngomba
336 \value [since 5.5] Nko
337 \value [since 6.5] NorthernFrisian
338 \value [since 5.7] NorthernLuri
339 \value NorthernSami
340 \value NorthernSotho
341 \value NorthNdebele
342 \value NorwegianBokmal
343 \value NorwegianNynorsk
344 \value Nuer
345 \value Nyanja
346 \value Nyankole
347 \value [since 6.5] Obolo
348 \value Occitan
349 \value [since 6.0] Odia
350 \value Ojibwa
351 \value [since 5.1] OldIrish
352 \value [since 5.1] OldNorse
353 \value [since 5.1] OldPersian
354 \value Oriya Obsolete, please use Odia
355 \value Oromo
356 \value [since 5.7] Osage
357 \value Ossetic
358 \value [since 5.1] Pahlavi
359 \value [since 5.7] Palauan
360 \value Pali
361 \value [since 5.7] Papiamento
362 \value Pashto
363 \value Persian
364 \value [since 5.1] Phoenician
365 \value [since 6.5] Pijin
366 \value Polish
367 \value Portuguese
368 \value [since 5.5] Prussian
369 \value Punjabi
370 \value Quechua
371 \value [since 6.5] Rajasthani
372 \value RhaetoRomance Obsolete, please use Romansh
373 \value [since 6.6] Rohingya
374 \value Romanian
375 \value Romansh
376 \value Rombo
377 \value Rundi
378 \value Russian
379 \value Rwa
380 \value Saho
381 \value Sakha
382 \value Samburu
383 \value Samoan
384 \value Sango
385 \value Sangu
386 \value Sanskrit
387 \value [since 5.1] Santali
388 \value Sardinian
389 \value [since 5.1] Saurashtra
390 \value Sena
391 \value Serbian
392 \value Shambala
393 \value Shona
394 \value SichuanYi
395 \value [since 5.12] Sicilian
396 \value Sidamo
397 \value [since 5.14] Silesian
398 \value Sindhi
399 \value Sinhala
400 \value [since 5.5] SkoltSami
401 \value Slovak
402 \value Slovenian
403 \value Soga
404 \value Somali
405 \value [since 5.12] SouthernKurdish
406 \value [since 5.5] SouthernSami
407 \value SouthernSotho
408 \value SouthNdebele
409 \value Spanish
410 \value [since 5.3] StandardMoroccanTamazight
411 \value Sundanese
412 \value Swahili
413 \value [since 6.9] SwampyCree
414 \value Swati
415 \value Swedish
416 \value SwissGerman
417 \value Syriac
418 \value Tachelhit
419 \value Tahitian
420 \value [since 5.1] TaiDam
421 \value Taita
422 \value Tajik
423 \value Tamil
424 \value Taroko
425 \value Tasawaq
426 \value Tatar
427 \value Telugu
428 \value Teso
429 \value Thai
430 \value Tibetan
431 \value Tigre
432 \value Tigrinya
433 \value [since 5.7] TokelauLanguage
434 \value [since 6.5] TokiPona
435 \value [since 5.7] TokPisin
436 \value Tongan
437 \value [since 6.6] Torwali
438 \value Tsonga
439 \value Tswana
440 \value Turkish
441 \value Turkmen
442 \value [since 5.7] TuvaluLanguage
443 \value Tyap
444 \value [since 5.1] Ugaritic
445 \value Uighur Obsolete, please use Uyghur
446 \value Uigur Obsolete, please use Uyghur
447 \value Ukrainian
448 \value [since 5.5] UpperSorbian
449 \value Urdu
450 \value [since 6.0] Uyghur
451 \value Uzbek
452 \value Vai
453 \value Venda
454 \value [since 6.7] Venetian
455 \value Vietnamese
456 \value Volapuk
457 \value Vunjo
458 \value Walamo Obsolete, please use Wolaytta
459 \value Walloon
460 \value Walser
461 \value [since 5.5] Warlpiri
462 \value Welsh
463 \value [since 5.12] WesternBalochi
464 \value WesternFrisian same as Frisian
465 \value [since 6.0] Wolaytta
466 \value Wolof
467 \value Xhosa
468 \value Yangben
469 \value Yiddish
470 \value Yoruba
471 \value Zarma
472 \value Zhuang
473 \value Zulu
474
475 \omitvalue LastLanguage
476
477 \sa language(), languageToString()
478*/
479
480/*!
481 \typealias QLocale::Territory
482
483 This enumeration type is an alias for \l Country,
484 which shall be renamed to Territory at a future release.
485
486 \sa territory(), territoryToString()
487*/
488
489/*!
490 \enum QLocale::Country
491
492 This enumerated type is used to identify a territory.
493
494 An individual territory may be a province of a country, a country (by far the
495 most common case) or a larger geographic entity, to which some localization
496 details are specific.
497
498 \value AnyCountry Osbolete alias for \c AnyTerritory
499 \value [since 6.2] AnyTerritory
500
501 \value Afghanistan
502 \value AlandIslands
503 \value Albania
504 \value Algeria
505 \value AmericanSamoa
506 \value Andorra
507 \value Angola
508 \value Anguilla
509 \value Antarctica
510 \value AntiguaAndBarbuda
511 \value Argentina
512 \value Armenia
513 \value Aruba
514 \value AscensionIsland
515 \value Australia
516 \value Austria
517 \value Azerbaijan
518 \value Bahamas
519 \value Bahrain
520 \value Bangladesh
521 \value Barbados
522 \value Belarus
523 \value Belgium
524 \value Belize
525 \value Benin
526 \value Bermuda
527 \value Bhutan
528 \value Bolivia
529 \value Bonaire
530 \value BosniaAndHerzegowina Obsolete, use \c BosniaAndHerzegovina instead
531 \value [since 6.0] BosniaAndHerzegovina
532 \value Botswana
533 \value BouvetIsland
534 \value Brazil
535 \value BritishIndianOceanTerritory
536 \value BritishVirginIslands
537 \value Brunei
538 \value Bulgaria
539 \value BurkinaFaso
540 \value Burundi
541 \value Cambodia
542 \value Cameroon
543 \value Canada
544 \value CanaryIslands
545 \value CaribbeanNetherlands
546 \value CapeVerde
547 \value CaymanIslands
548 \value CentralAfricanRepublic
549 \value CeutaAndMelilla
550 \value Chad
551 \value Chile
552 \value China
553 \value ChristmasIsland
554 \value ClippertonIsland
555 \value CocosIslands
556 \value Colombia
557 \value Comoros
558 \value CongoBrazzaville
559 \value CongoKinshasa
560 \value CookIslands
561 \value CostaRica
562 \value Croatia
563 \value Cuba
564 \value [since 6.0] Curacao
565 \value CuraSao Obsolete, use \c Curacao instead
566 \value Cyprus
567 \value [since 6.0] Czechia
568 \value CzechRepublic Obsolete, use \c Czechia instead
569 \value DemocraticRepublicOfCongo Obsolete, use \c CongoKinshasa instead
570 \value DemocraticRepublicOfKorea Obsolete, use \c NorthKorea instead
571 \value Denmark
572 \value DiegoGarcia
573 \value Djibouti
574 \value Dominica
575 \value DominicanRepublic
576 \value EastTimor
577 \value Ecuador
578 \value Egypt
579 \value ElSalvador
580 \value EquatorialGuinea
581 \value Eritrea
582 \value Estonia
583 \value Eswatini
584 \value Ethiopia
585 \value [since 5.7] EuropeanUnion
586 \value [since 5.12] Europe
587 \value FalklandIslands
588 \value FaroeIslands
589 \value Fiji
590 \value Finland
591 \value France
592 \value FrenchGuiana
593 \value FrenchPolynesia
594 \value FrenchSouthernTerritories
595 \value Gabon
596 \value Gambia
597 \value Georgia
598 \value Germany
599 \value Ghana
600 \value Gibraltar
601 \value Greece
602 \value Greenland
603 \value Grenada
604 \value Guadeloupe
605 \value Guam
606 \value Guatemala
607 \value Guernsey
608 \value Guinea
609 \value GuineaBissau
610 \value Guyana
611 \value Haiti
612 \value HeardAndMcDonaldIslands
613 \value Honduras
614 \value HongKong
615 \value Hungary
616 \value Iceland
617 \value India
618 \value Indonesia
619 \value Iran
620 \value Iraq
621 \value Ireland
622 \value IsleOfMan
623 \value Israel
624 \value Italy
625 \value IvoryCoast
626 \value Jamaica
627 \value Japan
628 \value Jersey
629 \value Jordan
630 \value Kazakhstan
631 \value Kenya
632 \value Kiribati
633 \value [since 5.2] Kosovo
634 \value Kuwait
635 \value Kyrgyzstan
636 \value Laos
637 \value LatinAmerica
638 \value LatinAmericaAndTheCaribbean Obsolete, use \c LatinAmerica instead
639 \value Latvia
640 \value Lebanon
641 \value Lesotho
642 \value Liberia
643 \value Libya
644 \value Liechtenstein
645 \value Lithuania
646 \value Luxembourg
647 \value Macao
648 \value Macau
649 \value Macedonia
650 \value Madagascar
651 \value Malawi
652 \value Malaysia
653 \value Maldives
654 \value Mali
655 \value Malta
656 \value MarshallIslands
657 \value Martinique
658 \value Mauritania
659 \value Mauritius
660 \value Mayotte
661 \value Mexico
662 \value Micronesia
663 \value Moldova
664 \value Monaco
665 \value Mongolia
666 \value Montenegro
667 \value Montserrat
668 \value Morocco
669 \value Mozambique
670 \value Myanmar
671 \value Namibia
672 \value NauruCountry Osbolete alias for \c NauruTerritory
673 \value [since 6.2] NauruTerritory
674 \value Nepal
675 \value Netherlands
676 \value NewCaledonia
677 \value NewZealand
678 \value Nicaragua
679 \value Niger
680 \value Nigeria
681 \value Niue
682 \value NorfolkIsland
683 \value NorthernMarianaIslands
684 \value NorthKorea
685 \value Norway
686 \value Oman
687 \value [since 5.7] OutlyingOceania
688 \value Pakistan
689 \value Palau
690 \value PalestinianTerritories
691 \value Panama
692 \value PapuaNewGuinea
693 \value Paraguay
694 \value PeoplesRepublicOfCongo Obsolete, use \c CongoBrazzaville instead
695 \value Peru
696 \value Philippines
697 \value Pitcairn
698 \value Poland
699 \value Portugal
700 \value PuertoRico
701 \value Qatar
702 \value RepublicOfKorea Obsolete, use \c SouthKorea instead
703 \value Reunion
704 \value Romania
705 \value RussianFederation
706 \value Russia
707 \value Rwanda
708 \value SaintBarthelemy
709 \value SaintHelena
710 \value SaintKittsAndNevis
711 \value SaintLucia
712 \value SaintMartin
713 \value SaintPierreAndMiquelon
714 \value SaintVincentAndGrenadines
715 \value SaintVincentAndTheGrenadines
716 \value Samoa
717 \value SanMarino
718 \value SaoTomeAndPrincipe
719 \value SaudiArabia
720 \value Senegal
721 \value Serbia
722 \value Seychelles
723 \value SierraLeone
724 \value Singapore
725 \value SintMaarten
726 \value Slovakia
727 \value Slovenia
728 \value SolomonIslands
729 \value Somalia
730 \value SouthAfrica
731 \value SouthGeorgiaAndSouthSandwichIslands
732 \value SouthGeorgiaAndTheSouthSandwichIslands
733 \value SouthKorea
734 \value SouthSudan
735 \value Spain
736 \value SriLanka
737 \value Sudan
738 \value Suriname
739 \value SvalbardAndJanMayen
740 \value SvalbardAndJanMayenIslands
741 \value Swaziland
742 \value Sweden
743 \value Switzerland
744 \value Syria
745 \value SyrianArabRepublic Obsolete, use \c Syria instead
746 \value Taiwan
747 \value Tajikistan
748 \value Tanzania
749 \value Thailand
750 \value TimorLeste
751 \value Togo
752 \value TokelauCountry Osbolete alias for \c TokelauTerritory
753 \value [since 6.2] TokelauTerritory
754 \value Tonga
755 \value TrinidadAndTobago
756 \value TristanDaCunha
757 \value Tunisia
758 \value Turkey
759 \value Turkmenistan
760 \value TurksAndCaicosIslands
761 \value TuvaluCountry Osbolete alias for \c TuvaluTerritory
762 \value [since 6.2] TuvaluTerritory
763 \value Uganda
764 \value Ukraine
765 \value UnitedArabEmirates
766 \value UnitedKingdom
767 \value UnitedStates
768 \value UnitedStatesOutlyingIslands
769 \value UnitedStatesMinorOutlyingIslands
770 \value UnitedStatesVirginIslands
771 \value Uruguay
772 \value Uzbekistan
773 \value Vanuatu
774 \value VaticanCity
775 \value VaticanCityState
776 \value Venezuela
777 \value Vietnam
778 \value WallisAndFutuna
779 \value WallisAndFutunaIslands
780 \value WesternSahara
781 \value [since 5.12] World
782 \value Yemen
783 \value Zambia
784 \value Zimbabwe
785
786 \omitvalue LastCountry Osbolete alias for \c LastTerritory
787 \omitvalue LastTerritory
788
789 \note Use the Territory alias for this enumeration where possible.
790 The Country enum shall be renamed to Territory at a later release.
791
792 \sa territory(), territoryToString(), codeToTerritory(), territoryToCode()
793*/
794
795/*!
796 \enum QLocale::Script
797
798 This enumerated type is used to specify a script.
799
800 \value AnyScript
801
802 \value [since 5.7] AdlamScript
803 \value [since 5.7] AhomScript
804 \value [since 5.7] AnatolianHieroglyphsScript
805 \value ArabicScript
806 \value ArmenianScript
807 \value [since 5.1] AvestanScript
808 \value [since 5.1] BalineseScript
809 \value [since 5.1] BamumScript
810 \value [since 6.0] BanglaScript
811 \value [since 5.5] BassaVahScript
812 \value [since 5.1] BatakScript
813 \value BengaliScript Obsolete, please use BanglaScript
814 \value [since 5.7] BhaiksukiScript
815 \value [since 5.1] BopomofoScript
816 \value [since 5.1] BrahmiScript
817 \value [since 5.1] BrailleScript
818 \value [since 5.1] BugineseScript
819 \value [since 5.1] BuhidScript
820 \value [since 5.1] CanadianAboriginalScript
821 \value [since 5.1] CarianScript
822 \value [since 5.5] CaucasianAlbanianScript
823 \value [since 5.1] ChakmaScript
824 \value [since 5.1] ChamScript
825 \value CherokeeScript
826 \value [since 5.1] CopticScript
827 \value [since 5.1] CuneiformScript
828 \value [since 5.1] CypriotScript
829 \value CyrillicScript
830 \value [since 5.1] DeseretScript
831 \value DevanagariScript
832 \value [since 5.5] DuployanScript
833 \value [since 5.1] EgyptianHieroglyphsScript
834 \value [since 5.5] ElbasanScript
835 \value EthiopicScript
836 \value [since 5.1] FraserScript
837 \value GeorgianScript
838 \value [since 5.1] GlagoliticScript
839 \value [since 5.1] GothicScript
840 \value [since 5.5] GranthaScript
841 \value GreekScript
842 \value GujaratiScript
843 \value GurmukhiScript
844 \value [since 5.1] HangulScript
845 \value [since 6.6] HanifiScript
846 \value [since 5.1] HanScript
847 \value [since 5.1] HanunooScript
848 \value [since 5.7] HanWithBopomofoScript
849 \value [since 5.7] HatranScript
850 \value HebrewScript
851 \value [since 5.1] HiraganaScript
852 \value [since 5.1] ImperialAramaicScript
853 \value [since 5.1] InscriptionalPahlaviScript
854 \value [since 5.1] InscriptionalParthianScript
855 \value [since 5.7] JamoScript
856 \value JapaneseScript
857 \value [since 5.1] JavaneseScript
858 \value [since 5.1] KaithiScript
859 \value KannadaScript
860 \value [since 5.1] KatakanaScript
861 \value [since 5.1] KayahLiScript
862 \value [since 5.1] KharoshthiScript
863 \value [since 5.1] KhmerScript
864 \value [since 5.5] KhojkiScript
865 \value [since 5.5] KhudawadiScript
866 \value KoreanScript
867 \value [since 5.1] LannaScript
868 \value LaoScript
869 \value LatinScript
870 \value [since 5.1] LepchaScript
871 \value [since 5.1] LimbuScript
872 \value [since 5.5] LinearAScript
873 \value [since 5.1] LinearBScript
874 \value [since 5.1] LycianScript
875 \value [since 5.1] LydianScript
876 \value [since 5.5] MahajaniScript
877 \value MalayalamScript
878 \value [since 5.1] MandaeanScript
879 \value [since 5.5] ManichaeanScript
880 \value [since 5.7] MarchenScript
881 \value [since 5.1] MeiteiMayekScript
882 \value [since 6.0] MendeScript
883 \value MendeKikakuiScript Obsolete, please use MendeScript
884 \value [since 5.1] MeroiticCursiveScript
885 \value [since 5.1] MeroiticScript
886 \value [since 5.5] ModiScript
887 \value MongolianScript
888 \value [since 5.5] MroScript
889 \value [since 5.7] MultaniScript
890 \value MyanmarScript
891 \value [since 5.5] NabataeanScript
892 \value [since 5.7] NewaScript
893 \value [since 5.1] NewTaiLueScript
894 \value [since 5.1] NkoScript
895 \value [since 5.1] OghamScript
896 \value [since 5.1] OlChikiScript
897 \value [since 5.7] OldHungarianScript
898 \value [since 5.1] OldItalicScript
899 \value [since 5.5] OldNorthArabianScript
900 \value [since 5.5] OldPermicScript
901 \value [since 5.1] OldPersianScript
902 \value [since 5.1] OldSouthArabianScript
903 \value [since 6.0] OdiaScript
904 \value OriyaScript Obsolete, please use OdiaScript
905 \value [since 5.1] OrkhonScript
906 \value [since 5.7] OsageScript
907 \value [since 5.1] OsmanyaScript
908 \value [since 5.5] PahawhHmongScript
909 \value [since 5.5] PalmyreneScript
910 \value [since 5.5] PauCinHauScript
911 \value [since 5.1] PhagsPaScript
912 \value [since 5.1] PhoenicianScript
913 \value [since 5.1] PollardPhoneticScript
914 \value [since 5.5] PsalterPahlaviScript
915 \value [since 5.1] RejangScript
916 \value [since 5.1] RunicScript
917 \value [since 5.1] SamaritanScript
918 \value [since 5.1] SaurashtraScript
919 \value [since 5.1] SharadaScript
920 \value [since 5.1] ShavianScript
921 \value [since 5.5] SiddhamScript
922 \value [since 5.7] SignWritingScript
923 \value SimplifiedChineseScript same as SimplifiedHanScript
924 \value SimplifiedHanScript same as SimplifiedChineseScript
925 \value SinhalaScript
926 \value [since 5.1] SoraSompengScript
927 \value [since 5.1] SundaneseScript
928 \value [since 5.1] SylotiNagriScript
929 \value SyriacScript
930 \value [since 5.1] TagalogScript
931 \value [since 5.1] TagbanwaScript
932 \value [since 5.1] TaiLeScript
933 \value [since 5.1] TaiVietScript
934 \value [since 5.1] TakriScript
935 \value TamilScript
936 \value [since 5.7] TangutScript
937 \value TeluguScript
938 \value ThaanaScript
939 \value ThaiScript
940 \value TibetanScript
941 \value TifinaghScript
942 \value [since 5.5] TirhutaScript
943 \value TraditionalChineseScript same as TraditionalHanScript
944 \value TraditionalHanScript same as TraditionalChineseScript
945 \value [since 5.1] UgariticScript
946 \value VaiScript
947 \value [since 5.5] VarangKshitiScript
948 \value YiScript
949
950 \omitvalue LastScript
951
952 \sa script(), scriptToString(), languageToString()
953*/
954
955/*!
956 \enum QLocale::FormatType
957
958 This enum describes the different formats that can be used when
959 converting QDate, QTime, and QDateTime objects, as well
960 as months and days, to strings specific to the locale.
961
962 \value LongFormat Longer format.
963
964 \value ShortFormat Shorter format.
965
966 \value NarrowFormat A special version for use when space is very limited.
967
968 \note \c NarrowFormat might contain the same text for
969 different months and days. It can even be an empty string if the
970 locale doesn't support narrow names, so you should avoid using it
971 for date formatting. Also, for the system locale this format is
972 the same as \c ShortFormat.
973
974 \sa dateFormat(), timeFormat(), dateTimeFormat()
975 \sa monthName(), standaloneMonthName(), dayName(), standaloneDayName()
976 \sa toDate(), toTime(), toDateTime()
977*/
978
979/*!
980 \enum QLocale::NumberOption
981
982 This enum defines a set of options for number-to-string and string-to-number
983 conversions. They can be retrieved with numberOptions() and set with
984 setNumberOptions().
985
986 \value DefaultNumberOptions This option represents the default behavior for
987 all locales except the C locale, with group separators, with one
988 leading zero in single digit exponents, and without trailing zeroes
989 at the end of the fractional part (when present).
990 \value OmitGroupSeparator If this option is set, the number-to-string
991 functions will not break up digits into groups. The C locale sets
992 this option by default. The default for all other locales is to
993 break up digits into groups, in the whole-number part of a number,
994 with group separators.
995 \value RejectGroupSeparator If this option is set, the string-to-number functions
996 will fail if they encounter group separators in their input. The default
997 is to accept numbers containing correctly placed group separators.
998 \value OmitLeadingZeroInExponent If this option is set, the number-to-string
999 functions will not pad exponents with zeroes when printing floating point
1000 numbers in scientific notation. The default is to add one leading zero to
1001 single digit exponents.
1002 \value RejectLeadingZeroInExponent If this option is set, the string-to-number
1003 functions will fail if they encounter an exponent padded with zeroes when
1004 parsing a floating point number in scientific notation. The default is to
1005 accept such padding.
1006 \value IncludeTrailingZeroesAfterDot If this option is set, the
1007 number-to-string functions will pad numbers with zeroes to the
1008 requested precision in "g" or "most concise" mode. The default is to
1009 omit trailing zeroes, which may leave fewer digits in the fractional
1010 part than the precision asked for.
1011 \value RejectTrailingZeroesAfterDot If this option is set, the
1012 string-to-number functions will fail if they encounter trailing
1013 zeroes at the end of the fractional part, when parsing a number in
1014 scientific or decimal representation. The default is to accept
1015 trailing zeroes.
1016
1017 \sa setNumberOptions(), numberOptions(), FloatingPointPrecisionOption
1018*/
1019
1020/*!
1021 \enum QLocale::FloatingPointPrecisionOption
1022
1023 This enum defines a constant that can be given as precision to QString::number(),
1024 QByteArray::number(), and QLocale::toString() when converting floats or doubles,
1025 in order to express a variable number of digits as precision.
1026
1027 \value FloatingPointShortest The conversion algorithm will try to find the
1028 shortest accurate representation for the given number. "Accurate" means
1029 that you get the exact same number back from an inverse conversion on
1030 the generated string representation. In particular, trailing zeros are
1031 omitted (from the mantissa, in exponent formats).
1032
1033 \sa toString(), QString::number(), QByteArray::number()
1034 \since 5.7
1035*/
1036
1037/*!
1038 \enum QLocale::MeasurementSystem
1039
1040 This enum defines which units are used for measurement.
1041
1042 \value MetricSystem This value indicates metric units, such as meters,
1043 centimeters and millimeters, based on \l
1044 {https://www.bipm.org/en/measurement-units} {SI}.
1045 \value ImperialUSSystem This value indicates imperial units, such as inches and
1046 miles as they are used in the United States.
1047 \value ImperialUKSystem This value indicates imperial units, such as inches and
1048 miles as they are used in the United Kingdom.
1049 \value ImperialSystem Provided for compatibility. Same as ImperialUSSystem
1050
1051 \since 4.4
1052*/
1053
1054/*!
1055 \enum QLocale::LanguageCodeType
1056
1057 This enum defines language code types that can be used to restrict set
1058 of language codes considered by \c codeToLanguage and \c languageToCode.
1059
1060 \value ISO639Part1 ISO 639 Part 1 Alpha 2 code.
1061 \value ISO639Part2B ISO 639 Part 2 bibliographic Alpha 3 code.
1062 \value ISO639Part2T ISO 639 Part 2 terminological Alpha 3 code.
1063 \value ISO639Part3 ISO 639 Part 3 Alpha 3 code.
1064 \value LegacyLanguageCode Codes that are not part of the above set, but that
1065 were supported by Qt in the past. This value can only be used by
1066 codeToLanguage(). It is ignored when passed to languageToCode().
1067 \value ISO639Part2 Any ISO 639 Part 2 code.
1068 \value ISO639Alpha2 Any ISO-639 2-letter code.
1069 \value ISO639Alpha3 Any ISO-639 3-letter code.
1070 \value ISO639 Any ISO 639 code.
1071 \value AnyLanguageCode Specifies that any code can be used.
1072*/
1073
1074/*!
1075 \fn bool QLocale::operator==(const QLocale &lhs, const QLocale &rhs)
1076
1077 Returns \c true if the two QLocale objects, \a lhs and \a rhs, are the same;
1078 otherwise returns \c false.
1079
1080 \note The system locale is not equal to the QLocale object constructed from
1081 its language(), script() and territory(), even if the two agree in all data
1082 fields. Nor are two locales with different number options equal.
1083
1084 \sa operator!=(), setNumberOptions()
1085*/
1086
1087/*!
1088 \fn bool QLocale::operator!=(const QLocale &lhs, const QLocale &rhs)
1089
1090 Returns \c true if the two QLocale objects, \a lhs and \a rhs, differ;
1091 otherwise returns \c false.
1092
1093 \note The system locale is not equal to the QLocale object constructed from
1094 its language(), script() and territory(), even if the two agree in all data
1095 fields. Nor are two locales with different number options equal.
1096
1097 \sa operator==(), setNumberOptions()
1098*/
1099
1100/*!
1101 \enum QLocale::QuotationStyle
1102
1103 This enum defines a set of possible styles for locale specific quotation.
1104
1105 \value StandardQuotation If this option is set, the standard quotation marks
1106 will be used to quote strings.
1107 \value AlternateQuotation If this option is set, the alternate quotation marks
1108 will be used to quote strings.
1109
1110 \since 4.8
1111
1112 \sa quoteString()
1113*/
1114
1115/*!
1116 \internal
1117 \class QSystemLocale
1118 \inmodule QtCore
1119 \brief The QSystemLocale class can be used to finetune the system locale
1120 of the user.
1121 \since 4.2
1122
1123 \ingroup i18n
1124
1125 \warning This class is only useful in very rare cases. Usually QLocale offers
1126 all the functionality required for application development.
1127
1128 QSystemLocale allows to override the values provided by the system
1129 locale (QLocale::system()).
1130
1131 \sa QLocale
1132*/
1133
1134/*!
1135 \enum QSystemLocale::QueryType
1136
1137 Specifies the type of information queried by query(). For each value
1138 the type of information to return from the query() method is listed.
1139
1140 \value LanguageId a uint specifying the language.
1141 \value ScriptId a uint specifying the script.
1142 \value TerritoryId a uint specifying the territory.
1143 \value DecimalPoint a QString specifying the decimal point.
1144 \value GroupSeparator a QString specifying the group separator.
1145 \value ZeroDigit a QString specifying the zero digit.
1146 \value NegativeSign a QString specifying the minus sign.
1147 \value PositiveSign a QString specifying the plus sign.
1148 \value DateFormatLong a QString specifying the long date format
1149 \value DateFormatShort a QString specifying the short date format
1150 \value TimeFormatLong a QString specifying the long time format
1151 \value TimeFormatShort a QString specifying the short time format
1152 \value DayNameLong a QString specifying the name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
1153 \value DayNameShort a QString specifying the short name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
1154 \value MonthNameLong a QString specifying the name of a month. the in variant contains an integer between 1 and 12
1155 \value MonthNameShort a QString specifying the short name of a month. the in variant contains an integer between 1 and 12
1156 \value DateToStringLong converts the QDate stored in the in variant to a QString using the long date format
1157 \value DateToStringShort converts the QDate stored in the in variant to a QString using the short date format
1158 \value TimeToStringLong converts the QTime stored in the in variant to a QString using the long time format
1159 \value TimeToStringShort converts the QTime stored in the in variant to a QString using the short time format
1160 \value DateTimeFormatLong a QString specifying the long date time format
1161 \value DateTimeFormatShort a QString specifying the short date time format
1162 \value DateTimeToStringLong converts the QDateTime in the in variant to a QString using the long datetime format
1163 \value DateTimeToStringShort converts the QDateTime in the in variant to a QString using the short datetime format
1164 \value MeasurementSystem a QLocale::MeasurementSystem enum specifying the measurement system
1165 \value AMText a string that represents the system AM designator associated with a 12-hour clock.
1166 \value PMText a string that represents the system PM designator associated with a 12-hour clock.
1167 \value FirstDayOfWeek a Qt::DayOfWeek enum specifying the first day of the week
1168 \value CurrencySymbol a string that represents a currency in a format QLocale::CurrencyFormat.
1169 \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.
1170 \value UILanguages a list of strings representing locale names that could be used for UI translation.
1171 \value StringToStandardQuotation a QString containing a quoted version of the string ref stored in the in variant using standard quotes.
1172 \value StringToAlternateQuotation a QString containing a quoted version of the string ref stored in the in variant using alternate quotes.
1173 \value Weekdays a QList<Qt::DayOfWeek> specifying the regular weekdays
1174 \value LocaleChanged this type is queried whenever the system locale is changed.
1175 \value ListToSeparatedString a string that represents a join of a given QStringList with a locale-defined separator.
1176 \value NativeLanguageName a string that represents the name of the native language.
1177 \value NativeTerritoryName a string that represents the name of the native territory.
1178
1179 \sa FormatType
1180*/
1181
1182/*!
1183 \fn QVariant QSystemLocale::query(QueryType type, QVariant &&in = QVariant()) const
1184
1185 Generic query method for locale data. Provides indirection.
1186 Denotes the \a type of the query
1187 with \a in as input data depending on the query.
1188
1189 \sa QSystemLocale::QueryType
1190*/
1191
1192/*!
1193 \fn QLocale QSystemLocale::fallbackLocale() const
1194
1195 \since 4.6
1196
1197 Returns the locale used if the system locale is not able to answer a query.
1198
1199 Must be a QLocale instance based on the built-in CLDR data, and should
1200 match what the system locale is using as closely as that data supports.
1201*/
1202
1203/*!
1204 \class QSystemLocale::CurrencyToStringArgument
1205 \inmodule QtCore
1206
1207 A helper class that provides arguments for the QSystemLocale::query()
1208 function with query type QSystemLocale::CurrencyToString.
1209
1210 \sa QSystemLocale::QueryType
1211 \since 4.8
1212*/
1213
1214/*!
1215 \fn QSystemLocale::CurrencyToStringArgument::CurrencyToStringArgument()
1216 \internal
1217*/
1218/*!
1219 \variable QSystemLocale::CurrencyToStringArgument::value
1220
1221 An input value that should be converted to its string representation.
1222 Contains one of QMetaType::LongLong, QMetaType::ULongLong or QMetaType::Double
1223 types.
1224*/
1225/*!
1226 \variable QSystemLocale::CurrencyToStringArgument::symbol
1227
1228 An optional argument containing a currency symbol to be used in the
1229 currency string.
1230*/
1231
1232/*!
1233\fn QString QLocale::toString(long i) const
1234
1235\overload
1236
1237\sa toLong()
1238*/
1239
1240/*!
1241\fn QString QLocale::toString(ulong i) const
1242
1243\overload
1244
1245\sa toULong()
1246*/
1247
1248/*!
1249\fn QString QLocale::toString(ushort i) const
1250
1251\overload
1252
1253\sa toUShort()
1254*/
1255
1256
1257/*!
1258\fn QString QLocale::toString(short i) const
1259
1260\overload
1261
1262\sa toShort()
1263*/
1264
1265/*!
1266\fn QString QLocale::toString(int i) const
1267
1268\overload
1269
1270\sa toInt()
1271*/
1272
1273/*!
1274\fn QString QLocale::toString(uint i) const
1275
1276\overload
1277
1278\sa toUInt()
1279*/
1280
1281/*
1282\fn QString QLocale::toString(long i) const
1283
1284\overload
1285
1286\sa toLong()
1287*/
1288
1289/*
1290\fn QString QLocale::toString(ulong i) const
1291
1292\overload
1293
1294\sa toULong()
1295*/
1296
1297/*!
1298\fn QString QLocale::toString(float f, char format = 'g', int precision = 6) const
1299\overload
1300
1301Returns a string representing the floating-point number \a f.
1302
1303The \a format and \a precision have the same meanings as described in \l
1304{toString(double, char, int)}.
1305
1306\sa toFloat(), toDouble(), numberOptions(), exponential(), decimalPoint(), zeroDigit(),
1307 positiveSign(), percent(), toCurrencyString(), formattedDataSize(),
1308 QLocale::FloatingPointPrecisionOption
1309*/
1310
1311/*!
1312 \fn QString QLocale::toCurrencyString(short value, const QString &symbol) const
1313 \since 4.8
1314 \overload
1315*/
1316
1317/*!
1318 \fn QString QLocale::toCurrencyString(ushort value, const QString &symbol) const
1319 \since 4.8
1320 \overload
1321*/
1322
1323/*!
1324 \fn QString QLocale::toCurrencyString(int value, const QString &symbol) const
1325 \since 4.8
1326 \overload
1327*/
1328
1329/*!
1330 \fn QString QLocale::toCurrencyString(uint value, const QString &symbol) const
1331 \since 4.8
1332 \overload
1333*/