diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 4 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 4 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.h | 7 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.qdoc | 627 | ||||
-rw-r--r-- | src/corelib/tools/qlocale_data_p.h | 32 | ||||
-rw-r--r-- | src/corelib/tools/qmakearray_p.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qoffsetstringarray_p.h | 200 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 6 | ||||
-rw-r--r-- | src/corelib/tools/tools.pri | 1 |
9 files changed, 560 insertions, 325 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index b53a60b9bf..1e591d6d69 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -3885,9 +3885,7 @@ static qulonglong toIntegral_helper(const char *data, bool *ok, int base, qulong template <typename T> static inline T toIntegral_helper(const char *data, bool *ok, int base) { - // ### Qt6: use std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type - const bool isUnsigned = T(0) < T(-1); - typedef typename QtPrivate::QConditional<isUnsigned, qulonglong, qlonglong>::Type Int64; + using Int64 = typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type; #if defined(QT_CHECK_RANGE) if (base != 0 && (base < 2 || base > 36)) { diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index b285e58779..7425302857 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1180,9 +1180,7 @@ static qulonglong toIntegral_helper(const QLocaleData *d, QStringView str, bool template <typename T> static inline T toIntegral_helper(const QLocalePrivate *d, QStringView str, bool *ok) { - // ### Qt6: use std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type - const bool isUnsigned = T(0) < T(-1); - typedef typename QtPrivate::QConditional<isUnsigned, qulonglong, qlonglong>::Type Int64; + using Int64 = typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type; // we select the right overload by the last, unused parameter Int64 val = toIntegral_helper(d->m_data, str, ok, d->m_numberOptions, Int64()); diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 8e6c5c503b..832988de31 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -436,6 +436,11 @@ public: Cantonese = 357, Osage = 358, Tangut = 359, + Ido = 360, + Lojban = 361, + Sicilian = 362, + SouthernKurdish = 363, + WesternBalochi = 364, Afan = Oromo, Bhutani = Dzongkha, @@ -452,7 +457,7 @@ public: Twi = Akan, Uigur = Uighur, - LastLanguage = Tangut + LastLanguage = WesternBalochi }; enum Script { diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index 5c0a9b63e5..0f83a765a5 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -105,42 +105,80 @@ \value AnyLanguage \value C The "C" locale is identical in behavior to English/UnitedStates. + \value Abkhazian - \value Oromo \value Afan Obsolete, please use Oromo \value Afar \value Afrikaans + \value Aghem + \value Ahom Since Qt 5.7 + \value Akan + \value Akkadian Since Qt 5.1 \value Akoose Since Qt 5.3 \value Albanian + \value AmericanSignLanguage Since Qt 5.7 \value Amharic + \value AncientEgyptian Since Qt 5.1 + \value AncientGreek Since Qt 5.1 + \value AncientNorthArabian Since Qt 5.5 \value Arabic + \value Aragonese Since Qt 5.1 + \value Aramaic Since Qt 5.1 + \value ArdhamagadhiPrakrit Since Qt 5.7 \value Armenian \value Assamese + \value Asturian + \value Asu + \value Atsam \value Avaric + \value Avestan \value Aymara \value Azerbaijani + \value Bafia + \value Balinese Since Qt 5.1 + \value Bambara + \value Bamun Since Qt 5.1 + \value Basaa \value Bashkir \value Basque + \value Bassa Since Qt 5.5 + \value BatakToba Since Qt 5.1 + \value Belarusian + \value Bemba + \value Bena \value Bengali - \value Dzongkha + \value Bhojpuri Since Qt 5.7 \value Bhutani Obsolete, please use Dzongkha \value Bihari \value Bislama - \value Bosnian + \value Blin \value Bodo + \value Bosnian \value Breton + \value Buginese Since Qt 5.1 + \value Buhid Since Qt 5.1 \value Bulgarian \value Burmese - \value Belarusian \value Byelorussian Obsolete, please use Belarusian - \value Khmer \value Cambodian Obsolete, please use Khmer + \value Cantonese Since Qt 5.7 + \value Carian Since Qt 5.1 \value Catalan + \value CentralKurdish Since Qt 5.5 + \value CentralMoroccoTamazight + \value Chakma Since Qt 5.1 \value Chamorro \value Chechen + \value Cherokee + \value Chewa Obsolete, please use Nyanja + \value Chiga \value Chinese \value Church \value Chuvash + \value ClassicalMandaic Since Qt 5.1 + \value Colognian + \value CongoSwahili + \value Coptic Since Qt 5.1 \value Cornish \value Corsican \value Cree @@ -148,33 +186,58 @@ \value Czech \value Danish \value Divehi + \value Dogri Since Qt 5.1 + \value Duala \value Dutch + \value Dzongkha + \value EasternCham Since Qt 5.1 + \value EasternKayah Since Qt 5.1 + \value Embu \value English \value Esperanto \value Estonian + \value Etruscan Since Qt 5.1 + \value Ewe + \value Ewondo \value Faroese \value Fijian + \value Filipino \value Finnish \value French - \value WesternFrisian same as Frisian \value Frisian same as WesternFrisian + \value Friulian + \value Fulah + \value Ga \value Gaelic \value Galician + \value Ganda + \value Geez \value Georgian \value German + \value Gothic Since Qt 5.1 \value Greek \value Greenlandic \value Guarani \value Gujarati + \value Gusii \value Haitian + \value Hanunoo Since Qt 5.1 \value Hausa + \value Hawaiian \value Hebrew \value Herero + \value HieroglyphicLuwian Since Qt 5.7 \value Hindi \value HiriMotu + \value HmongNjua Since Qt 5.5 + \value Ho Since Qt 5.5 \value Hungarian \value Icelandic + \value Ido Since Qt 5.12 + \value Igbo + \value InariSami Since Qt 5.5 \value Indonesian + \value Ingush Since Qt 5.1 \value Interlingua \value Interlingue \value Inuktitut @@ -183,306 +246,244 @@ \value Italian \value Japanese \value Javanese + \value Jju + \value JolaFonyi + \value Kabuverdianu + \value Kabyle + \value Kako + \value Kalenjin + \value Kamba \value Kannada \value Kanuri \value Kashmiri \value Kazakh + \value Kenyang Since Qt 5.5 + \value Khmer + \value Kiche Since Qt 5.5 + \value Kikuyu \value Kinyarwanda \value Kirghiz \value Komi \value Kongo + \value Konkani \value Korean + \value Koro + \value KoyraboroSenni + \value KoyraChiini + \value Kpelle \value Kurdish - \value Rundi \value Kurundi Obsolete, please use Rundi \value Kwanyama + \value Kwasio \value Lakota Since Qt 5.3 + \value Langi \value Lao + \value LargeFloweryMiao Since Qt 5.1 \value Latin \value Latvian + \value Lepcha Since Qt 5.1 + \value Lezghian Since Qt 5.5 \value Limburgish + \value Limbu Since Qt 5.1 + \value LinearA Since Qt 5.5 \value Lingala + \value Lisu Since Qt 5.1 + \value LiteraryChinese Since Qt 5.7 \value Lithuanian + \value Lojban Since Qt 5.12 + \value LowerSorbian Since Qt 5.5 + \value LowGerman \value LubaKatanga + \value LuleSami Since Qt 5.5 + \value Luo + \value Lu Since Qt 5.1 \value Luxembourgish - \value Marshallese + \value Luyia + \value Lycian Since Qt 5.1 + \value Lydian Since Qt 5.1 \value Macedonian + \value Machame + \value Maithili Since Qt 5.5 + \value MakhuwaMeetto + \value Makonde \value Malagasy \value Malay \value Malayalam \value Maltese + \value Mandingo Since Qt 5.1 + \value ManichaeanMiddlePersian Since Qt 5.5 + \value Manipuri Since Qt 5.1 \value Manx \value Maori + \value Mapuche Since Qt 5.5 \value Marathi + \value Marshallese + \value Masai + \value Mazanderani Since Qt 5.7 + \value Mende Since Qt 5.5 + \value Meroitic Since Qt 5.1 + \value Meru + \value Meta + \value Mohawk Since Qt 5.5 \value Moldavian Obsolete, please use Romanian \value Mongolian + \value Mono Since Qt 5.5 + \value Morisyen + \value Mru Since Qt 5.7 + \value Mundang + \value Nama \value NauruLanguage \value Navaho \value Ndonga \value Nepali - \value Norwegian same as NorwegianBokmal + \value Newari Since Qt 5.7 + \value Ngiemboon + \value Ngomba + \value Nko Since Qt 5.5 + \value NorthernLuri Since Qt 5.7 + \value NorthernSami + \value NorthernSotho + \value NorthernThai Since Qt 5.1 + \value NorthNdebele \value NorwegianBokmal same as Norwegian \value NorwegianNynorsk + \value Norwegian same as NorwegianBokmal + \value Nuer + \value Nyanja + \value Nyankole \value Occitan \value Ojibwa + \value OldIrish Since Qt 5.1 + \value OldNorse Since Qt 5.1 + \value OldPersian Since Qt 5.1 + \value OldTurkish Since Qt 5.1 \value Oriya + \value Oromo + \value Osage Since Qt 5.7 \value Ossetic + \value Pahlavi Since Qt 5.1 + \value Palauan Since Qt 5.7 \value Pali + \value Papiamento Since Qt 5.7 + \value Parthian Since Qt 5.1 \value Pashto \value Persian + \value Phoenician Since Qt 5.1 \value Polish \value Portuguese + \value PrakritLanguage Since Qt 5.1 + \value Prussian Since Qt 5.5 \value Punjabi \value Quechua - \value Romansh + \value Rejang Since Qt 5.1 \value RhaetoRomance Obsolete, please use Romansh \value Romanian + \value Romansh + \value Rombo + \value Rundi \value Russian + \value Rwa + \value Sabaean Since Qt 5.1 + \value Saho + \value Sakha + \value Samaritan Since Qt 5.1 + \value Samburu \value Samoan \value Sango + \value Sangu \value Sanskrit + \value Santali Since Qt 5.1 + \value Saraiki Since Qt 5.7 \value Sardinian + \value Saurashtra Since Qt 5.1 + \value Sena \value Serbian \value SerboCroatian Obsolete, please use Serbian - \value SouthernSotho - \value Tswana + \value Shambala \value Shona + \value SichuanYi + \value Sicilian Since Qt 5.12 + \value Sidamo \value Sindhi \value Sinhala - \value Swati + \value SkoltSami Since Qt 5.5 \value Slovak \value Slovenian + \value Soga \value Somali + \value Sora Since Qt 5.1 + \value SouthernKurdish Since Qt 5.12 + \value SouthernSami Since Qt 5.5 + \value SouthernSotho + \value SouthNdebele \value Spanish \value StandardMoroccanTamazight Since Qt 5.3 \value Sundanese \value Swahili + \value Swati \value Swedish + \value SwissGerman + \value Sylheti Since Qt 5.1 + \value Syriac + \value Tachelhit \value Tagalog Obsolete, please use Filipino + \value Tagbanwa Since Qt 5.1 \value Tahitian + \value TaiDam Since Qt 5.1 + \value TaiNua Since Qt 5.1 + \value Taita \value Tajik \value Tamil + \value Tangut Since Qt 5.7 + \value Taroko + \value Tasawaq \value Tatar + \value TedimChin Since Qt 5.5 \value Telugu + \value Teso \value Thai \value Tibetan + \value Tigre \value Tigrinya + \value TokelauLanguage Since Qt 5.7 + \value TokPisin Since Qt 5.7 \value Tongan \value Tsonga + \value Tswana \value Turkish \value Turkmen + \value TuvaluLanguage Since Qt 5.7 \value Twi Obsolete, please use Akan + \value Tyap + \value Ugaritic Since Qt 5.1 \value Uighur \value Uigur Obsolete, please use Uighur \value Ukrainian + \value UncodedLanguages Since Qt 5.7 + \value UpperSorbian Since Qt 5.5 \value Urdu \value Uzbek + \value Vai + \value Venda \value Vietnamese \value Volapuk + \value Vunjo + \value Walamo \value Walloon + \value Walser + \value Warlpiri Since Qt 5.5 \value Welsh + \value WesternBalochi Since Qt 5.12 + \value WesternFrisian same as Frisian \value Wolof \value Xhosa + \value Yangben \value Yiddish \value Yoruba + \value Zarma \value Zhuang \value Zulu - \value Bosnian - \value Divehi - \value Manx - \value Cornish - \value Akan - \value Konkani - \value Ga - \value Igbo - \value Kamba - \value Syriac - \value Blin - \value Geez - \value Koro - \value Sidamo - \value Atsam - \value Tigre - \value Jju - \value Friulian - \value Venda - \value Ewe - \value Walamo - \value Hawaiian - \value Tyap - \value Nyanja - \value Chewa Obsolete, please use Nyanja - \value Filipino - \value SwissGerman - \value SichuanYi - \value Kpelle - \value LowGerman - \value SouthNdebele - \value NorthernSotho - \value NorthernSami - \value Taroko - \value Gusii - \value Taita - \value Fulah - \value Kikuyu - \value Samburu - \value Sena - \value NorthNdebele - \value Rombo - \value Tachelhit - \value Kabyle - \value Nyankole - \value Bena - \value Vunjo - \value Bambara - \value Embu - \value Cherokee - \value Morisyen - \value Makonde - \value Langi - \value Ganda - \value Bemba - \value Kabuverdianu - \value Meru - \value Kalenjin - \value Nama - \value Machame - \value Colognian - \value Masai - \value Soga - \value Luyia - \value Asu - \value Teso - \value Saho - \value KoyraChiini - \value Rwa - \value Luo - \value Chiga - \value CentralMoroccoTamazight - \value KoyraboroSenni - \value Shambala - \value Aghem - \value Basaa - \value Zarma - \value Duala - \value JolaFonyi - \value Ewondo - \value Bafia - \value MakhuwaMeetto - \value Mundang - \value Kwasio - \value Nuer - \value Sakha - \value Sangu - \value CongoSwahili - \value Tasawaq - \value Vai - \value Walser - \value Yangben - \value Avestan - \value Asturian - \value Ngomba - \value Kako - \value Meta - \value Ngiemboon - \value Aragonese - \value Akkadian - \value AncientEgyptian - \value AncientGreek - \value Aramaic - \value Balinese - \value Bamun - \value BatakToba - \value Buginese - \value Buhid - \value Carian - \value Chakma - \value ClassicalMandaic - \value Coptic - \value Dogri - \value EasternCham - \value EasternKayah - \value Etruscan - \value Gothic - \value Hanunoo - \value Ingush - \value LargeFloweryMiao - \value Lepcha - \value Limbu - \value Lisu - \value Lu - \value Lycian - \value Lydian - \value Mandingo - \value Manipuri - \value Meroitic - \value NorthernThai - \value OldIrish - \value OldNorse - \value OldPersian - \value OldTurkish - \value Pahlavi - \value Parthian - \value Phoenician - \value PrakritLanguage - \value Rejang - \value Sabaean - \value Samaritan - \value Santali - \value Saurashtra - \value Sora - \value Sylheti - \value Tagbanwa - \value TaiDam - \value TaiNua - \value Ugaritic - \value Mapuche Since Qt 5.5 - \value CentralKurdish Since Qt 5.5 - \value LowerSorbian Since Qt 5.5 - \value UpperSorbian Since Qt 5.5 - \value Kenyang Since Qt 5.5 - \value Mohawk Since Qt 5.5 - \value Nko Since Qt 5.5 - \value Prussian Since Qt 5.5 - \value Kiche Since Qt 5.5 - \value SouthernSami Since Qt 5.5 - \value LuleSami Since Qt 5.5 - \value InariSami Since Qt 5.5 - \value SkoltSami Since Qt 5.5 - \value Warlpiri Since Qt 5.5 - \value ManichaeanMiddlePersian Since Qt 5.5 - \value Mende Since Qt 5.5 - \value AncientNorthArabian Since Qt 5.5 - \value LinearA Since Qt 5.5 - \value HmongNjua Since Qt 5.5 - \value Ho Since Qt 5.5 - \value Lezghian Since Qt 5.5 - \value Bassa Since Qt 5.5 - \value Mono Since Qt 5.5 - \value TedimChin Since Qt 5.5 - \value Maithili Since Qt 5.5 - \value LowerSorbian Since Qt 5.5 - \value UpperSorbian Since Qt 5.5 - \value Ahom Since Qt 5.7 - \value AmericanSignLanguage Since Qt 5.7 - \value ArdhamagadhiPrakrit Since Qt 5.7 - \value Bhojpuri Since Qt 5.7 - \value Cantonese Since Qt 5.7 - \value HieroglyphicLuwian Since Qt 5.7 - \value LiteraryChinese Since Qt 5.7 - \value Mazanderani Since Qt 5.7 - \value Mru Since Qt 5.7 - \value Newari Since Qt 5.7 - \value NorthernLuri Since Qt 5.7 - \value Osage Since Qt 5.7 - \value Palauan Since Qt 5.7 - \value Papiamento Since Qt 5.7 - \value Saraiki Since Qt 5.7 - \value Tangut Since Qt 5.7 - \value TokelauLanguage Since Qt 5.7 - \value TokPisin Since Qt 5.7 - \value TuvaluLanguage Since Qt 5.7 - \value UncodedLanguages Since Qt 5.7 + \omitvalue LastLanguage \sa language(), languageToString() @@ -494,7 +495,9 @@ This enumerated type is used to specify a country. \value AnyCountry + \value Afghanistan + \value AlandIslands \value Albania \value Algeria \value AmericanSamoa @@ -506,6 +509,7 @@ \value Argentina \value Armenia \value Aruba + \value AscensionIsland \value Australia \value Austria \value Azerbaijan @@ -520,11 +524,13 @@ \value Bermuda \value Bhutan \value Bolivia + \value Bonaire \value BosniaAndHerzegowina \value Botswana \value BouvetIsland \value Brazil \value BritishIndianOceanTerritory + \value BritishVirginIslands \value Brunei \value Bulgaria \value BurkinaFaso @@ -536,6 +542,7 @@ \value CapeVerde \value CaymanIslands \value CentralAfricanRepublic + \value CeutaAndMelilla \value Chad \value Chile \value China @@ -544,18 +551,19 @@ \value CocosIslands \value Colombia \value Comoros - \value CongoKinshasa \value CongoBrazzaville - \value DemocraticRepublicOfCongo Obsolete, please use CongoKinshasa - \value PeoplesRepublicOfCongo Obsolete, please use CongoBrazzaville + \value CongoKinshasa \value CookIslands \value CostaRica - \value IvoryCoast \value Croatia \value Cuba + \value CuraSao \value Cyprus \value CzechRepublic + \value DemocraticRepublicOfCongo Obsolete, please use CongoKinshasa + \value DemocraticRepublicOfKorea Obsolete, please use NorthKorea \value Denmark + \value DiegoGarcia \value Djibouti \value Dominica \value DominicanRepublic @@ -604,19 +612,18 @@ \value Iran \value Iraq \value Ireland + \value IsleOfMan \value Israel \value Italy + \value IvoryCoast \value Jamaica \value Japan + \value Jersey \value Jordan \value Kazakhstan \value Kenya \value Kiribati - \value NorthKorea - \value SouthKorea - \value DemocraticRepublicOfKorea Obsolete, please use NorthKorea - \value RepublicOfKorea Obsolete, please use SouthKorea - \value Kosovo + \value Kosovo Since Qt 5.2 \value Kuwait \value Kyrgyzstan \value Laos @@ -648,6 +655,7 @@ \value Moldova \value Monaco \value Mongolia + \value Montenegro \value Montserrat \value Morocco \value Mozambique @@ -664,6 +672,7 @@ \value Niue \value NorfolkIsland \value NorthernMarianaIslands + \value NorthKorea \value Norway \value Oman \value OutlyingOceania Since Qt 5.7 @@ -673,6 +682,7 @@ \value Panama \value PapuaNewGuinea \value Paraguay + \value PeoplesRepublicOfCongo Obsolete, please use CongoBrazzaville \value Peru \value Philippines \value Pitcairn @@ -680,32 +690,39 @@ \value Portugal \value PuertoRico \value Qatar + \value RepublicOfKorea Obsolete, please use SouthKorea \value Reunion \value Romania - \value Russia same as RussianFederation \value RussianFederation same as Russia + \value Russia same as RussianFederation \value Rwanda + \value SaintBarthelemy + \value SaintHelena \value SaintKittsAndNevis \value SaintLucia + \value SaintMartin + \value SaintPierreAndMiquelon \value SaintVincentAndTheGrenadines \value Samoa \value SanMarino \value SaoTomeAndPrincipe \value SaudiArabia \value Senegal + \value Serbia \value Seychelles \value SierraLeone \value Singapore + \value SintMaarten \value Slovakia \value Slovenia \value SolomonIslands \value Somalia \value SouthAfrica \value SouthGeorgiaAndTheSouthSandwichIslands + \value SouthKorea + \value SouthSudan \value Spain \value SriLanka - \value SaintHelena - \value SaintPierreAndMiquelon \value Sudan \value Suriname \value SvalbardAndJanMayenIslands @@ -723,6 +740,7 @@ \value Tokelau Obsolete, please use TokelauCountry \value Tonga \value TrinidadAndTobago + \value TristanDaCunha \value Tunisia \value Turkey \value Turkmenistan @@ -735,35 +753,20 @@ \value UnitedKingdom \value UnitedStates \value UnitedStatesMinorOutlyingIslands + \value UnitedStatesVirginIslands \value Uruguay \value Uzbekistan \value Vanuatu \value VaticanCityState \value Venezuela \value Vietnam - \value BritishVirginIslands - \value UnitedStatesVirginIslands \value WallisAndFutunaIslands \value WesternSahara \value World Since Qt 5.12 \value Yemen \value Zambia \value Zimbabwe - \value Montenegro - \value Serbia - \value SaintBarthelemy - \value SaintMartin - \value AscensionIsland - \value AlandIslands - \value DiegoGarcia - \value CeutaAndMelilla - \value IsleOfMan - \value Jersey - \value TristanDaCunha - \value SouthSudan - \value CuraSao - \value Bonaire - \value SintMaarten + \omitvalue LastCountry \sa country(), countryToString() @@ -775,135 +778,136 @@ This enumerated type is used to specify a script. \value AnyScript + \value AdlamScript Since Qt 5.7 \value AhomScript Since Qt 5.7 \value AnatolianHieroglyphsScript Since Qt 5.7 \value ArabicScript \value ArmenianScript - \value AvestanScript - \value BalineseScript - \value BamumScript + \value AvestanScript Since Qt 5.1 + \value BalineseScript Since Qt 5.1 + \value BamumScript Since Qt 5.1 \value BassaVahScript Since Qt 5.5 - \value BatakScript + \value BatakScript Since Qt 5.1 \value BengaliScript \value BhaiksukiScript Since Qt 5.7 - \value BopomofoScript - \value BrahmiScript - \value BrailleScript - \value BugineseScript - \value BuhidScript - \value CanadianAboriginalScript - \value CarianScript + \value BopomofoScript Since Qt 5.1 + \value BrahmiScript Since Qt 5.1 + \value BrailleScript Since Qt 5.1 + \value BugineseScript Since Qt 5.1 + \value BuhidScript Since Qt 5.1 + \value CanadianAboriginalScript Since Qt 5.1 + \value CarianScript Since Qt 5.1 \value CaucasianAlbanianScript Since Qt 5.5 - \value ChakmaScript - \value ChamScript + \value ChakmaScript Since Qt 5.1 + \value ChamScript Since Qt 5.1 \value CherokeeScript - \value CopticScript - \value CypriotScript + \value CopticScript Since Qt 5.1 + \value CuneiformScript Since Qt 5.1 + \value CypriotScript Since Qt 5.1 \value CyrillicScript - \value DeseretScript + \value DeseretScript Since Qt 5.1 \value DevanagariScript \value DuployanScript Since Qt 5.5 - \value EgyptianHieroglyphsScript + \value EgyptianHieroglyphsScript Since Qt 5.1 \value ElbasanScript Since Qt 5.5 \value EthiopicScript - \value FraserScript + \value FraserScript Since Qt 5.1 \value GeorgianScript - \value GlagoliticScript - \value GothicScript + \value GlagoliticScript Since Qt 5.1 + \value GothicScript Since Qt 5.1 \value GranthaScript Since Qt 5.5 \value GreekScript \value GujaratiScript \value GurmukhiScript - \value HanScript - \value HangulScript - \value HanunooScript + \value HangulScript Since Qt 5.1 + \value HanScript Since Qt 5.1 + \value HanunooScript Since Qt 5.1 \value HanWithBopomofoScript Since Qt 5.7 \value HatranScript Since Qt 5.7 \value HebrewScript - \value HiraganaScript - \value ImperialAramaicScript - \value InscriptionalPahlaviScript - \value InscriptionalParthianScript + \value HiraganaScript Since Qt 5.1 + \value ImperialAramaicScript Since Qt 5.1 + \value InscriptionalPahlaviScript Since Qt 5.1 + \value InscriptionalParthianScript Since Qt 5.1 \value JamoScript Since Qt 5.7 \value JapaneseScript - \value JavaneseScript - \value KaithiScript + \value JavaneseScript Since Qt 5.1 + \value KaithiScript Since Qt 5.1 \value KannadaScript - \value KatakanaScript - \value KayahLiScript - \value KharoshthiScript - \value KhmerScript + \value KatakanaScript Since Qt 5.1 + \value KayahLiScript Since Qt 5.1 + \value KharoshthiScript Since Qt 5.1 + \value KhmerScript Since Qt 5.1 \value KhojkiScript Since Qt 5.5 \value KhudawadiScript Since Qt 5.5 \value KoreanScript - \value LannaScript + \value LannaScript Since Qt 5.1 \value LaoScript \value LatinScript - \value LepchaScript - \value LimbuScript + \value LepchaScript Since Qt 5.1 + \value LimbuScript Since Qt 5.1 \value LinearAScript Since Qt 5.5 - \value LinearBScript - \value LycianScript - \value LydianScript + \value LinearBScript Since Qt 5.1 + \value LycianScript Since Qt 5.1 + \value LydianScript Since Qt 5.1 \value MahajaniScript Since Qt 5.5 \value MalayalamScript - \value MandaeanScript + \value MandaeanScript Since Qt 5.1 \value ManichaeanScript Since Qt 5.5 \value MarchenScript Since Qt 5.7 - \value MeiteiMayekScript + \value MeiteiMayekScript Since Qt 5.1 \value MendeKikakuiScript Since Qt 5.5 - \value MeroiticScript - \value MeroiticCursiveScript + \value MeroiticCursiveScript Since Qt 5.1 + \value MeroiticScript Since Qt 5.1 \value ModiScript Since Qt 5.5 \value MongolianScript \value MroScript Since Qt 5.5 \value MultaniScript Since Qt 5.7 \value MyanmarScript \value NabataeanScript Since Qt 5.5 - \value NkoScript \value NewaScript Since Qt 5.7 - \value NewTaiLueScript - \value OghamScript - \value OlChikiScript - \value OldItalicScript + \value NewTaiLueScript Since Qt 5.1 + \value NkoScript Since Qt 5.1 + \value OghamScript Since Qt 5.1 + \value OlChikiScript Since Qt 5.1 \value OldHungarianScript Since Qt 5.7 + \value OldItalicScript Since Qt 5.1 \value OldNorthArabianScript Since Qt 5.5 \value OldPermicScript Since Qt 5.5 - \value OldPersianScript - \value OldSouthArabianScript + \value OldPersianScript Since Qt 5.1 + \value OldSouthArabianScript Since Qt 5.1 \value OriyaScript - \value OrkhonScript + \value OrkhonScript Since Qt 5.1 \value OsageScript Since Qt 5.7 - \value OsmanyaScript + \value OsmanyaScript Since Qt 5.1 \value PahawhHmongScript Since Qt 5.5 \value PalmyreneScript Since Qt 5.5 \value PauCinHauScript Since Qt 5.5 - \value PhagsPaScript - \value PhoenicianScript - \value PollardPhoneticScript + \value PhagsPaScript Since Qt 5.1 + \value PhoenicianScript Since Qt 5.1 + \value PollardPhoneticScript Since Qt 5.1 \value PsalterPahlaviScript Since Qt 5.5 - \value RejangScript - \value RunicScript - \value SamaritanScript - \value SaurashtraScript - \value SharadaScript - \value ShavianScript + \value RejangScript Since Qt 5.1 + \value RunicScript Since Qt 5.1 + \value SamaritanScript Since Qt 5.1 + \value SaurashtraScript Since Qt 5.1 + \value SharadaScript Since Qt 5.1 + \value ShavianScript Since Qt 5.1 \value SiddhamScript Since Qt 5.5 \value SignWritingScript Since Qt 5.7 - \value SimplifiedHanScript same as SimplifiedChineseScript \value SimplifiedChineseScript same as SimplifiedHanScript + \value SimplifiedHanScript same as SimplifiedChineseScript \value SinhalaScript - \value SoraSompengScript - \value CuneiformScript - \value SundaneseScript - \value SylotiNagriScript + \value SoraSompengScript Since Qt 5.1 + \value SundaneseScript Since Qt 5.1 + \value SylotiNagriScript Since Qt 5.1 \value SyriacScript - \value TagalogScript - \value TagbanwaScript - \value TaiLeScript - \value TaiVietScript - \value TakriScript + \value TagalogScript Since Qt 5.1 + \value TagbanwaScript Since Qt 5.1 + \value TaiLeScript Since Qt 5.1 + \value TaiVietScript Since Qt 5.1 + \value TakriScript Since Qt 5.1 \value TamilScript \value TangutScript Since Qt 5.7 \value TeluguScript @@ -912,12 +916,13 @@ \value TibetanScript \value TifinaghScript \value TirhutaScript Since Qt 5.5 - \value TraditionalHanScript same as TraditionalChineseScript \value TraditionalChineseScript same as TraditionalHanScript - \value UgariticScript + \value TraditionalHanScript same as TraditionalChineseScript + \value UgariticScript Since Qt 5.1 \value VaiScript \value VarangKshitiScript Since Qt 5.5 \value YiScript + \omitvalue LastScript \sa script(), scriptToString(), languageToString() diff --git a/src/corelib/tools/qlocale_data_p.h b/src/corelib/tools/qlocale_data_p.h index aeeec2b085..fcff04011f 100644 --- a/src/corelib/tools/qlocale_data_p.h +++ b/src/corelib/tools/qlocale_data_p.h @@ -77,7 +77,7 @@ static const int ImperialMeasurementSystemsCount = // GENERATED PART STARTS HERE /* - This part of the file was generated on 2018-08-13 from the + This part of the file was generated on 2018-08-15 from the Common Locale Data Repository v33.1 http://www.unicode.org/cldr/ @@ -122,6 +122,7 @@ static const QLocaleId likely_subtags[] = { { 195, 0, 0 }, { 195, 7, 239 }, // bem -> bem_Latn_ZM { 186, 0, 0 }, { 186, 7, 210 }, // bez -> bez_Latn_TZ { 20, 0, 0 }, { 20, 2, 33 }, // bg -> bg_Cyrl_BG + { 364, 0, 0 }, { 364, 1, 163 }, // bgn -> bgn_Arab_PK { 343, 0, 0 }, { 343, 13, 100 }, // bho -> bho_Deva_IN { 18, 0, 0 }, { 18, 7, 229 }, // bi -> bi_Latn_VU { 270, 0, 0 }, { 270, 7, 170 }, // bku -> bku_Latn_PH @@ -224,10 +225,12 @@ static const QLocaleId likely_subtags[] = { { 168, 0, 0 }, { 168, 34, 44 }, // ii -> ii_Yiii_CN { 56, 0, 0 }, { 56, 7, 225 }, // ik -> ik_Latn_US { 281, 0, 0 }, { 281, 2, 178 }, // inh -> inh_Cyrl_RU + { 360, 0, 0 }, { 360, 7, 260 }, // io -> io_Latn_001 { 51, 0, 0 }, { 51, 7, 99 }, // is -> is_Latn_IS { 58, 0, 0 }, { 58, 7, 106 }, // it -> it_Latn_IT { 55, 0, 0 }, { 55, 44, 38 }, // iu -> iu_Cans_CA { 59, 0, 0 }, { 59, 19, 108 }, // ja -> ja_Jpan_JP + { 361, 0, 0 }, { 361, 7, 260 }, // jbo -> jbo_Latn_001 { 257, 0, 0 }, { 257, 7, 37 }, // jgo -> jgo_Latn_CM { 200, 0, 0 }, { 200, 7, 210 }, // jmc -> jmc_Latn_TZ { 60, 0, 0 }, { 60, 7, 101 }, // jv -> jv_Latn_ID @@ -385,10 +388,12 @@ static const QLocaleId likely_subtags[] = { { 305, 0, 0 }, { 305, 90, 100 }, // saz -> saz_Saur_IN { 249, 0, 0 }, { 249, 7, 210 }, // sbp -> sbp_Latn_TZ { 115, 0, 0 }, { 115, 7, 106 }, // sc -> sc_Latn_IT + { 362, 0, 0 }, { 362, 7, 106 }, // scn -> scn_Latn_IT { 105, 0, 0 }, { 105, 1, 163 }, // sd -> sd_Arab_PK { 105, 13, 0 }, { 105, 13, 100 }, // sd_Deva -> sd_Deva_IN { 105, 111, 0 }, { 105, 111, 100 }, // sd_Khoj -> sd_Khoj_IN { 105, 125, 0 }, { 105, 125, 100 }, // sd_Sind -> sd_Sind_IN + { 363, 0, 0 }, { 363, 1, 102 }, // sdh -> sdh_Arab_IR { 173, 0, 0 }, { 173, 7, 161 }, // se -> se_Latn_NO { 180, 0, 0 }, { 180, 7, 146 }, // seh -> seh_Latn_MZ { 213, 0, 0 }, { 213, 7, 132 }, // ses -> ses_Latn_ML @@ -1252,6 +1257,11 @@ static const quint16 locale_index[] = { 564, // Cantonese 0, // Osage 0, // Tangut + 566, // Ido + 567, // Lojban + 568, // Sicilian + 569, // Southern Kurdish + 570, // Western Balochi 0 // trailing 0 }; @@ -1823,6 +1833,11 @@ static const QLocaleData locale_data[] = { { 349, 1, 103, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 38181,77 , 38181,77 , 158,27 , 38181,77 , 38181,77 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,81,68}, 44,5 , 0,7 , 8,5 , 4,0 , 5731,11 , 0,0 , 0, 0, 6, 5, 6 }, // Northern Luri/Arabic/Iraq { 357, 6, 97, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 170,5 , 170,5 , 951,5 , 951,5 , 412,8 , 441,14 , 198,6 , 215,13 , 4671,39 , 4671,39 , 158,27 , 4671,39 , 4671,39 , 158,27 , 2023,28 , 2023,28 , 2051,14 , 2023,28 , 2023,28 , 2051,14 , 60,2 , 57,2 , 45,4 , 5,17 , 22,23 , {72,75,68}, 130,3 , 17057,11 , 4,4 , 4,0 , 5742,2 , 5744,14 , 2, 1, 7, 6, 7 }, // Cantonese/Traditional Han/Hong Kong { 357, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 170,5 , 170,5 , 951,5 , 951,5 , 412,8 , 420,13 , 198,6 , 204,11 , 4671,39 , 4710,38 , 158,27 , 4671,39 , 4710,38 , 158,27 , 2002,21 , 2023,28 , 2051,14 , 2002,21 , 2023,28 , 2051,14 , 60,2 , 57,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 129,1 , 3122,13 , 4,4 , 4,0 , 5758,2 , 5760,7 , 2, 1, 7, 6, 7 }, // Cantonese/Simplified Han/China + { 360, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Ido/Latin/World + { 361, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Lojban/Latin/World + { 362, 7, 106, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Sicilian/Latin/Italy + { 363, 1, 102, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 5 }, // Southern Kurdish/Arabic/Iran + { 364, 1, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 172,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 7, 6, 7 }, // Western Balochi/Arabic/Pakistan { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, {0,0,0}, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0, 0, 0, 0, 0 } // trailing 0s }; @@ -6667,6 +6682,11 @@ static const char language_name_list[] = "Cantonese\0" "Osage\0" "Tangut\0" +"Ido\0" +"Lojban\0" +"Sicilian\0" +"Southern Kurdish\0" +"Western Balochi\0" ; static const quint16 language_name_index[] = { @@ -7030,6 +7050,11 @@ static const quint16 language_name_index[] = { 3050, // Cantonese 3060, // Osage 3066, // Tangut + 3073, // Ido + 3077, // Lojban + 3084, // Sicilian + 3093, // Southern Kurdish + 3110, // Western Balochi }; static const char script_name_list[] = @@ -8213,6 +8238,11 @@ static const unsigned char language_code_list[] = "yue" // Cantonese "osa" // Osage "txg" // Tangut +"io\0" // Ido +"jbo" // Lojban +"scn" // Sicilian +"sdh" // Southern Kurdish +"bgn" // Western Balochi ; static const unsigned char script_code_list[] = diff --git a/src/corelib/tools/qmakearray_p.h b/src/corelib/tools/qmakearray_p.h index ae4d7f07c6..71441c2c27 100644 --- a/src/corelib/tools/qmakearray_p.h +++ b/src/corelib/tools/qmakearray_p.h @@ -111,10 +111,10 @@ struct QuickSortFilter<Predicate, QuickSortData<Head, Tail...>> using TailFilteredData = typename QuickSortFilter< Predicate, QuickSortData<Tail...>>::Type; - using Type = typename QConditional< + using Type = typename std::conditional< Predicate<Head>::value, decltype(quickSortConcat(QuickSortData<Head> {}, TailFilteredData{})), - TailFilteredData>::Type; + TailFilteredData>::type; }; template <template <typename> class Predicate> diff --git a/src/corelib/tools/qoffsetstringarray_p.h b/src/corelib/tools/qoffsetstringarray_p.h new file mode 100644 index 0000000000..1dc429a9bd --- /dev/null +++ b/src/corelib/tools/qoffsetstringarray_p.h @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QOFFSETSTRINGARRAY_P_H +#define QOFFSETSTRINGARRAY_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "private/qglobal_p.h" + +#include <tuple> +#include <array> + +QT_BEGIN_NAMESPACE + +namespace QtPrivate { +template<int N, int O, int I, int ... Idx> +struct OffsetSequenceHelper : OffsetSequenceHelper<N - 1, O + I, Idx..., O> { }; + +template<int Last, int I, int S, int ... Idx> +struct OffsetSequenceHelper<1, Last, I, S, Idx...> : IndexesList<Last + I, Idx..., Last> +{ + static const constexpr auto Length = Last + I; + using Type = typename std::conditional< + Last <= std::numeric_limits<quint8>::max(), + quint8, + typename std::conditional< + Last <= std::numeric_limits<quint16>::max(), + quint16, + int>::type + >::type; +}; + +template<int ... Idx> +struct OffsetSequence : OffsetSequenceHelper<sizeof ... (Idx), 0, Idx..., 0> { }; + +template<int N> +struct StaticString +{ + const char data[N]; + + static constexpr int size() noexcept + { + return N; + } +}; + + +template<> +struct StaticString<0> +{ + static constexpr int size() noexcept + { + return 0; + } +}; + +template<typename, typename> +struct StaticStringBuilder; + +template<int ... I1, int ... I2> +struct StaticStringBuilder<IndexesList<I1...>, IndexesList<I2...>> +{ + +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4100) // The formal parameter is not referenced in the body of the function. + // The unreferenced parameter is ignored. + // It happens when 'rs' is StaticString<0> + template<int N1, typename T2> + static constexpr StaticString<N1 + T2::size()> concatenate( + const char (&ls)[N1], const T2 &rs) noexcept + { + return {ls[I1]..., rs.data[I2]...}; + } +QT_WARNING_POP +}; + +template<int Sum> +constexpr StaticString<0> staticString() noexcept +{ + return StaticString<0>{}; +} + +template<int Sum, int I, int ... Ix> +constexpr StaticString<Sum> staticString(const char (&s)[I], const char (&...sx)[Ix]) noexcept +{ + return StaticStringBuilder< + makeIndexSequence<I>, + makeIndexSequence<Sum - I>>::concatenate(s, staticString<Sum - I>(sx...)); +} +} // namespace QtPrivate + +template<typename T, int SizeString, int SizeOffsets> +class QOffsetStringArray +{ +public: + using Type = T; + + template<int ... Ox> + constexpr QOffsetStringArray(const QtPrivate::StaticString<SizeString> &str, + QtPrivate::IndexesList<SizeString, Ox...>) noexcept + : m_string{str}, + m_offsets{Ox...} + { } + + constexpr inline const char *operator[](const int index) const noexcept + { + return m_string.data + m_offsets[qBound(int(0), index, SizeOffsets - 1)]; + } + + constexpr inline const char *at(const int index) const noexcept + { + return m_string.data + m_offsets[index]; + } + + constexpr inline const char *str() const { return m_string.data; } + constexpr inline const T *offsets() const { return m_offsets; } + constexpr inline int count() const { return SizeOffsets; }; + + static constexpr const auto sizeString = SizeString; + static constexpr const auto sizeOffsets = SizeOffsets; + +private: + QtPrivate::StaticString<SizeString> m_string; + const T m_offsets[SizeOffsets]; +}; + +template<typename T, int N, int ... Ox> +constexpr QOffsetStringArray<T, N, sizeof ... (Ox)> qOffsetStringArray( + const QtPrivate::StaticString<N> &string, + QtPrivate::IndexesList<N, Ox...> offsets) noexcept +{ + return QOffsetStringArray<T, N, sizeof ... (Ox)>( + string, + offsets); +} + +template<int ... Nx> +struct QOffsetStringArrayRet +{ + using Offsets = QtPrivate::OffsetSequence<Nx...>; + using Type = QOffsetStringArray<typename Offsets::Type, Offsets::Length, sizeof ... (Nx)>; +}; + +template<int ... Nx> +constexpr auto qOffsetStringArray(const char (&...strings)[Nx]) noexcept -> typename QOffsetStringArrayRet<Nx...>::Type +{ + using Offsets = QtPrivate::OffsetSequence<Nx...>; + return qOffsetStringArray<typename Offsets::Type>( + QtPrivate::staticString<Offsets::Length>(strings...), Offsets{}); +} + +QT_END_NAMESPACE + +#endif // QOFFSETSTRINGARRAY_P_H diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 6be3dcdbe1..da76601e88 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -899,10 +899,8 @@ private: template <typename T> static T toIntegral_helper(const QChar *data, int len, bool *ok, int base) { - // ### Qt6: use std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type - const bool isUnsigned = T(0) < T(-1); - typedef typename QtPrivate::QConditional<isUnsigned, qulonglong, qlonglong>::Type Int64; - typedef typename QtPrivate::QConditional<isUnsigned, uint, int>::Type Int32; + using Int64 = typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type; + using Int32 = typename std::conditional<std::is_unsigned<T>::value, uint, int>::type; // we select the right overload by casting size() to int or uint Int64 val = toIntegral_helper(data, Int32(len), ok, base); diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index dc28e0e0a2..995bab694e 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -39,6 +39,7 @@ HEADERS += \ tools/qmargins.h \ tools/qmessageauthenticationcode.h \ tools/qcontiguouscache.h \ + tools/qoffsetstringarray_p.h \ tools/qpair.h \ tools/qpoint.h \ tools/qqueue.h \ |