内容表

上一话题

QLineF

下一话题

QLockFile

QLocale

QLocale class converts between numbers and their string representations in various languages. 更多

Inheritance diagram of PySide2.QtCore.QLocale

概要

函数

静态函数

详细描述

QLocale is initialized with a language/country pair in its constructor and offers number-to-string and string-to-number conversion functions similar to those in QString .

范例:

egyptian = QLocale(QLocale.Arabic, QLocale.Egypt)
s1 = egyptian.toString(1.571429E+07, 'e')
s2 = egyptian.toString(10)
(d, ok) = egyptian.toDouble(s1)
(i, ok) = egyptian.toInt(s2)
											

QLocale supports the concept of a default locale, which is determined from the system’s locale settings at application startup. The default locale can be changed by calling the static member setDefault() . Setting the default locale has the following effects:

  • QLocale object is constructed with the default constructor, it will use the default locale’s settings.

  • toInt() , toDouble() , etc., interpret the string according to the default locale. If this fails, it falls back on the “C” locale.

  • arg() uses the default locale to format a number when its position specifier in the format string contains an ‘L’, e.g. “%L1”.

The following example illustrates how to use QLocale directly:

QLocale.setDefault(QLocale(QLocale.Hebrew, QLocale.Israel))
hebrew = QLocale() # Constructs a default QLocale
s1 = hebrew.toString(15714.3, 'e')
QLocale.setDefault(QLocale(QLocale.C))
c = QLocale()
(d, ok) = c.toDouble("1234,56")   # ok == false
(d, ok) = c.toDouble("1234.56")   # ok == true, d == 1234.56
QLocale.setDefault(QLocale(QLocale.German))
german = QLocale()
(d, ok) = german.toDouble("1234,56")   # ok == true, d == 1234.56
(d, ok) = german.toDouble("1234.56")   # ok == true, d == 1234.56
QLocale.setDefault(QLocale(QLocale.English, QLocale.UnitedStates))
english = QLocale()
string = '%s %s %10x' % (12345, english.toString(12345), 12345)
# string == "12345 12,345 3039"
											

When a language/country pair is specified in the constructor, one of three things can happen:

  • If the language/country pair is found in the database, it is used.

  • If the language is found but the country is not, or if the country is AnyCountry , the language is used with the most appropriate available country (for example, Germany for German),

  • If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault() ).

使用 language() and country() to determine the actual language and country values used.

An alternative method for constructing a QLocale object is by specifying the locale name.

korean = QLocale("ko")
swiss = QLocale("de_CH")
											

This constructor converts the locale name to a language/country pair; it does not use the system locale database.

注意

对于当前键盘输入区域设置,请查看 locale() .

QLocale ‘s data is based on Common Locale Data Repository v36.

另请参阅

arg() toInt() toDouble() locale()

class QLocale

QLocale(language[, country=AnyCountry])

QLocale(language, script, country)

QLocale(other)

QLocale(name)

param name

unicode

param script

Script

param language

Language

param other

QLocale

param country

Country

构造 QLocale object initialized with the default locale. If no default locale was set using setDefault() , this locale will be the same as the one returned by system() .

另请参阅

setDefault()

构造 QLocale object with the specified language and country .

  • If the language/country pair is found in the database, it is used.

  • If the language is found but the country is not, or if the country is AnyCountry , the language is used with the most appropriate available country (for example, Germany for German),

  • If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault() ).

The language and country that are actually used can be queried using language() and country() .

构造 QLocale object with the specified language , script and country .

  • If the language/script/country is found in the database, it is used.

  • If both script is AnyScript and country is AnyCountry , the language is used with the most appropriate available script and country (for example, Germany for German),

  • If either script is AnyScript or country is AnyCountry , the language is used with the first locale that matches the given script and country .

  • If neither the language nor the country are found, QLocale defaults to the default locale (see setDefault() ).

The language, script and country that are actually used can be queried using language() , script() and country() .

PySide2.QtCore.QLocale. Language

This enumerated type is used to specify a language.

常量

描述

QLocale.AnyLanguage

QLocale.C

A simplified English locale; see c()

QLocale.Abkhazian

QLocale.Afan

Obsolete, please use Oromo

QLocale.Afar

QLocale.Afrikaans

QLocale.Aghem

QLocale.Ahom

Since Qt 5.7

QLocale.Akan

QLocale.Akkadian

Since Qt 5.1

QLocale.Akoose

Since Qt 5.3

QLocale.Albanian

QLocale.AmericanSignLanguage

Since Qt 5.7

QLocale.Amharic

QLocale.AncientEgyptian

Since Qt 5.1

QLocale.AncientGreek

Since Qt 5.1

QLocale.AncientNorthArabian

Since Qt 5.5

QLocale.Arabic

QLocale.Aragonese

Since Qt 5.1

QLocale.Aramaic

Since Qt 5.1

QLocale.ArdhamagadhiPrakrit

Since Qt 5.7

QLocale.Armenian

QLocale.Assamese

QLocale.Asturian

QLocale.Asu

QLocale.Atsam

QLocale.Avaric

QLocale.Avestan

QLocale.Aymara

QLocale.Azerbaijani

QLocale.Bafia

QLocale.Balinese

Since Qt 5.1

QLocale.Bambara

QLocale.Bamun

Since Qt 5.1

QLocale.Basaa

QLocale.Bashkir

QLocale.Basque

QLocale.Bassa

Since Qt 5.5

QLocale.BatakToba

Since Qt 5.1

QLocale.Belarusian

QLocale.Bemba

QLocale.Bena

QLocale.Bengali

QLocale.Bhojpuri

Since Qt 5.7

QLocale.Bhutani

Obsolete, please use Dzongkha

QLocale.Bihari

QLocale.Bislama

QLocale.Blin

QLocale.Bodo

QLocale.Bosnian

QLocale.Breton

QLocale.Buginese

Since Qt 5.1

QLocale.Buhid

Since Qt 5.1

QLocale.Bulgarian

QLocale.Burmese

QLocale.Byelorussian

Obsolete, please use Belarusian

QLocale.Cambodian

Obsolete, please use Khmer

QLocale.Cantonese

Since Qt 5.7

QLocale.Carian

Since Qt 5.1

QLocale.Catalan

QLocale.Cebuano

Since Qt 5.14

QLocale.CentralKurdish

Since Qt 5.5

QLocale.CentralMoroccoTamazight

QLocale.Chakma

Since Qt 5.1

QLocale.Chamorro

QLocale.Chechen

QLocale.Cherokee

QLocale.Chewa

Obsolete, please use Nyanja

QLocale.Chickasaw

Since Qt 5.14

QLocale.Chiga

QLocale.Chinese

(Mandarin)

QLocale.Church

QLocale.Chuvash

QLocale.ClassicalMandaic

Since Qt 5.1

QLocale.Colognian

QLocale.CongoSwahili

QLocale.Coptic

Since Qt 5.1

QLocale.Cornish

QLocale.Corsican

QLocale.Cree

QLocale.Croatian

QLocale.Czech

QLocale.Danish

QLocale.Divehi

QLocale.Dogri

Since Qt 5.1

QLocale.Duala

QLocale.Dutch

QLocale.Dzongkha

QLocale.EasternCham

Since Qt 5.1

QLocale.EasternKayah

Since Qt 5.1

QLocale.Embu

QLocale.English

QLocale.Erzya

Since Qt 5.14

QLocale.Esperanto

QLocale.Estonian

QLocale.Etruscan

Since Qt 5.1

QLocale.Ewe

QLocale.Ewondo

QLocale.Faroese

QLocale.Fijian

QLocale.Filipino

QLocale.Finnish

QLocale.French

QLocale.Frisian

如同

QLocale.Friulian

QLocale.Fulah

QLocale.Ga

QLocale.Gaelic

QLocale.Galician

QLocale.Ganda

QLocale.Geez

QLocale.Georgian

QLocale.German

QLocale.Gothic

Since Qt 5.1

QLocale.Greek

QLocale.Greenlandic

QLocale.Guarani

QLocale.Gujarati

QLocale.Gusii

QLocale.Haitian

QLocale.Hanunoo

Since Qt 5.1

QLocale.Hausa

QLocale.Hawaiian

QLocale.Hebrew

QLocale.Herero

QLocale.HieroglyphicLuwian

Since Qt 5.7

QLocale.Hindi

QLocale.HiriMotu

QLocale.HmongNjua

Since Qt 5.5

QLocale.Ho

Since Qt 5.5

QLocale.Hungarian

QLocale.Icelandic

QLocale.Ido

Since Qt 5.12

QLocale.Igbo

QLocale.InariSami

Since Qt 5.5

QLocale.Indonesian

QLocale.Ingush

Since Qt 5.1

QLocale.Interlingua

QLocale.Interlingue

QLocale.Inuktitut

QLocale.Inupiak

QLocale.Irish

QLocale.Italian

QLocale.Japanese

QLocale.Javanese

QLocale.Jju

QLocale.JolaFonyi

QLocale.Kabuverdianu

QLocale.Kabyle

QLocale.Kako

QLocale.Kalenjin

QLocale.Kamba

QLocale.Kannada

QLocale.Kanuri

QLocale.Kashmiri

QLocale.Kazakh

QLocale.Kenyang

Since Qt 5.5

QLocale.Khmer

QLocale.Kiche

Since Qt 5.5

QLocale.Kikuyu

QLocale.Kinyarwanda

QLocale.Kirghiz

QLocale.Komi

QLocale.Kongo

QLocale.Konkani

QLocale.Korean

QLocale.Koro

QLocale.KoyraboroSenni

QLocale.KoyraChiini

QLocale.Kpelle

QLocale.Kurdish

QLocale.Kurundi

Obsolete, please use Rundi

QLocale.Kwanyama

QLocale.Kwasio

QLocale.Lakota

Since Qt 5.3

QLocale.Langi

QLocale.Lao

QLocale.LargeFloweryMiao

Since Qt 5.1

QLocale.Latin

QLocale.Latvian

QLocale.Lepcha

Since Qt 5.1

QLocale.Lezghian

Since Qt 5.5

QLocale.Limburgish

QLocale.Limbu

Since Qt 5.1

QLocale.LinearA

Since Qt 5.5

QLocale.Lingala

QLocale.Lisu

Since Qt 5.1

QLocale.LiteraryChinese

Since Qt 5.7

QLocale.Lithuanian

QLocale.Lojban

Since Qt 5.12

QLocale.LowerSorbian

Since Qt 5.5

QLocale.LowGerman

QLocale.LubaKatanga

QLocale.LuleSami

Since Qt 5.5

QLocale.Luo

QLocale.Lu

Since Qt 5.1

QLocale.Luxembourgish

QLocale.Luyia

QLocale.Lycian

Since Qt 5.1

QLocale.Lydian

Since Qt 5.1

QLocale.Macedonian

QLocale.Machame

QLocale.Maithili

Since Qt 5.5

QLocale.MakhuwaMeetto

QLocale.Makonde

QLocale.Malagasy

QLocale.Malay

QLocale.Malayalam

QLocale.Maltese

QLocale.Mandingo

Since Qt 5.1

QLocale.ManichaeanMiddlePersian

Since Qt 5.5

QLocale.Manipuri

Since Qt 5.1

QLocale.Manx

QLocale.Maori

QLocale.Mapuche

Since Qt 5.5

QLocale.Marathi

QLocale.Marshallese

QLocale.Masai

QLocale.Mazanderani

Since Qt 5.7

QLocale.Mende

Since Qt 5.5

QLocale.Meroitic

Since Qt 5.1

QLocale.Meru

QLocale.Meta

QLocale.Mohawk

Since Qt 5.5

QLocale.Moldavian

Obsolete, please use Romanian

QLocale.Mongolian

QLocale.Mono

Since Qt 5.5

QLocale.Morisyen

QLocale.Mru

Since Qt 5.7

QLocale.Mundang

QLocale.Muscogee

Since Qt 5.14

QLocale.Nama

QLocale.NauruLanguage

QLocale.Navaho

QLocale.Ndonga

QLocale.Nepali

QLocale.Newari

Since Qt 5.7

QLocale.Ngiemboon

QLocale.Ngomba

QLocale.Nko

Since Qt 5.5

QLocale.NorthernLuri

Since Qt 5.7

QLocale.NorthernSami

QLocale.NorthernSotho

QLocale.NorthernThai

Since Qt 5.1

QLocale.NorthNdebele

QLocale.NorwegianBokmal

same as Norwegian

QLocale.NorwegianNynorsk

QLocale.Norwegian

如同

QLocale.Nuer

QLocale.Nyanja

QLocale.Nyankole

QLocale.Occitan

QLocale.Ojibwa

QLocale.OldIrish

Since Qt 5.1

QLocale.OldNorse

Since Qt 5.1

QLocale.OldPersian

Since Qt 5.1

QLocale.OldTurkish

Since Qt 5.1

QLocale.Oriya

QLocale.Oromo

QLocale.Osage

Since Qt 5.7

QLocale.Ossetic

QLocale.Pahlavi

Since Qt 5.1

QLocale.Palauan

Since Qt 5.7

QLocale.Pali

QLocale.Papiamento

Since Qt 5.7

QLocale.Parthian

Since Qt 5.1

QLocale.Pashto

QLocale.Persian

QLocale.Phoenician

Since Qt 5.1

QLocale.Polish

QLocale.Portuguese

QLocale.PrakritLanguage

Since Qt 5.1

QLocale.Prussian

Since Qt 5.5

QLocale.Punjabi

QLocale.Quechua

QLocale.Rejang

Since Qt 5.1

QLocale.RhaetoRomance

Obsolete, please use Romansh

QLocale.Romanian

QLocale.Romansh

QLocale.Rombo

QLocale.Rundi

QLocale.Russian

QLocale.Rwa

QLocale.Sabaean

Since Qt 5.1

QLocale.Saho

QLocale.Sakha

QLocale.Samaritan

Since Qt 5.1

QLocale.Samburu

QLocale.Samoan

QLocale.Sango

QLocale.Sangu

QLocale.Sanskrit

QLocale.Santali

Since Qt 5.1

QLocale.Saraiki

Since Qt 5.7

QLocale.Sardinian

QLocale.Saurashtra

Since Qt 5.1

QLocale.Sena

QLocale.Serbian

QLocale.SerboCroatian

Obsolete, please use Serbian

QLocale.Shambala

QLocale.Shona

QLocale.SichuanYi

QLocale.Sicilian

Since Qt 5.12

QLocale.Sidamo

QLocale.Silesian

Since Qt 5.14

QLocale.Sindhi

QLocale.Sinhala

QLocale.SkoltSami

Since Qt 5.5

QLocale.Slovak

QLocale.Slovenian

QLocale.Soga

QLocale.Somali

QLocale.Sora

Since Qt 5.1

QLocale.SouthernKurdish

Since Qt 5.12

QLocale.SouthernSami

Since Qt 5.5

QLocale.SouthernSotho

QLocale.SouthNdebele

QLocale.Spanish

QLocale.StandardMoroccanTamazight

Since Qt 5.3

QLocale.Sundanese

QLocale.Swahili

QLocale.Swati

QLocale.Swedish

QLocale.SwissGerman

QLocale.Sylheti

Since Qt 5.1

QLocale.Syriac

QLocale.Tachelhit

QLocale.Tagalog

Obsolete, please use Filipino

QLocale.Tagbanwa

Since Qt 5.1

QLocale.Tahitian

QLocale.TaiDam

Since Qt 5.1

QLocale.TaiNua

Since Qt 5.1

QLocale.Taita

QLocale.Tajik

QLocale.Tamil

QLocale.Tangut

Since Qt 5.7

QLocale.Taroko

QLocale.Tasawaq

QLocale.Tatar

QLocale.TedimChin

Since Qt 5.5

QLocale.Telugu

QLocale.Teso

QLocale.Thai

QLocale.Tibetan

QLocale.Tigre

QLocale.Tigrinya

QLocale.TokelauLanguage

Since Qt 5.7

QLocale.TokPisin

Since Qt 5.7

QLocale.Tongan

QLocale.Tsonga

QLocale.Tswana

QLocale.Turkish

QLocale.Turkmen

QLocale.TuvaluLanguage

Since Qt 5.7

QLocale.Twi

Obsolete, please use Akan

QLocale.Tyap

QLocale.Ugaritic

Since Qt 5.1

QLocale.Uighur

QLocale.Uigur

Obsolete, please use Uighur

QLocale.Ukrainian

QLocale.UncodedLanguages

Since Qt 5.7

QLocale.UpperSorbian

Since Qt 5.5

QLocale.Urdu

QLocale.Uzbek

QLocale.Vai

QLocale.Venda

QLocale.Vietnamese

QLocale.Volapuk

QLocale.Vunjo

QLocale.Walamo

QLocale.Walloon

QLocale.Walser

QLocale.Warlpiri

Since Qt 5.5

QLocale.Welsh

QLocale.WesternBalochi

Since Qt 5.12

QLocale.WesternFrisian

same as Frisian

QLocale.Wolof

QLocale.Xhosa

QLocale.Yangben

QLocale.Yiddish

QLocale.Yoruba

QLocale.Zarma

QLocale.Zhuang

QLocale.Zulu

PySide2.QtCore.QLocale. Script

This enumerated type is used to specify a script.

常量

描述

QLocale.AnyScript

QLocale.AdlamScript

Since Qt 5.7

QLocale.AhomScript

Since Qt 5.7

QLocale.AnatolianHieroglyphsScript

Since Qt 5.7

QLocale.ArabicScript

QLocale.ArmenianScript

QLocale.AvestanScript

Since Qt 5.1

QLocale.BalineseScript

Since Qt 5.1

QLocale.BamumScript

Since Qt 5.1

QLocale.BassaVahScript

Since Qt 5.5

QLocale.BatakScript

Since Qt 5.1

QLocale.BengaliScript

QLocale.BhaiksukiScript

Since Qt 5.7

QLocale.BopomofoScript

Since Qt 5.1

QLocale.BrahmiScript

Since Qt 5.1

QLocale.BrailleScript

Since Qt 5.1

QLocale.BugineseScript

Since Qt 5.1

QLocale.BuhidScript

Since Qt 5.1

QLocale.CanadianAboriginalScript

Since Qt 5.1

QLocale.CarianScript

Since Qt 5.1

QLocale.CaucasianAlbanianScript

Since Qt 5.5

QLocale.ChakmaScript

Since Qt 5.1

QLocale.ChamScript

Since Qt 5.1

QLocale.CherokeeScript

QLocale.CopticScript

Since Qt 5.1

QLocale.CuneiformScript

Since Qt 5.1

QLocale.CypriotScript

Since Qt 5.1

QLocale.CyrillicScript

QLocale.DeseretScript

Since Qt 5.1

QLocale.DevanagariScript

QLocale.DuployanScript

Since Qt 5.5

QLocale.EgyptianHieroglyphsScript

Since Qt 5.1

QLocale.ElbasanScript

Since Qt 5.5

QLocale.EthiopicScript

QLocale.FraserScript

Since Qt 5.1

QLocale.GeorgianScript

QLocale.GlagoliticScript

Since Qt 5.1

QLocale.GothicScript

Since Qt 5.1

QLocale.GranthaScript

Since Qt 5.5

QLocale.GreekScript

QLocale.GujaratiScript

QLocale.GurmukhiScript

QLocale.HangulScript

Since Qt 5.1

QLocale.HanScript

Since Qt 5.1

QLocale.HanunooScript

Since Qt 5.1

QLocale.HanWithBopomofoScript

Since Qt 5.7

QLocale.HatranScript

Since Qt 5.7

QLocale.HebrewScript

QLocale.HiraganaScript

Since Qt 5.1

QLocale.ImperialAramaicScript

Since Qt 5.1

QLocale.InscriptionalPahlaviScript

Since Qt 5.1

QLocale.InscriptionalParthianScript

Since Qt 5.1

QLocale.JamoScript

Since Qt 5.7

QLocale.JapaneseScript

QLocale.JavaneseScript

Since Qt 5.1

QLocale.KaithiScript

Since Qt 5.1

QLocale.KannadaScript

QLocale.KatakanaScript

Since Qt 5.1

QLocale.KayahLiScript

Since Qt 5.1

QLocale.KharoshthiScript

Since Qt 5.1

QLocale.KhmerScript

Since Qt 5.1

QLocale.KhojkiScript

Since Qt 5.5

QLocale.KhudawadiScript

Since Qt 5.5

QLocale.KoreanScript

QLocale.LannaScript

Since Qt 5.1

QLocale.LaoScript

QLocale.LatinScript

QLocale.LepchaScript

Since Qt 5.1

QLocale.LimbuScript

Since Qt 5.1

QLocale.LinearAScript

Since Qt 5.5

QLocale.LinearBScript

Since Qt 5.1

QLocale.LycianScript

Since Qt 5.1

QLocale.LydianScript

Since Qt 5.1

QLocale.MahajaniScript

Since Qt 5.5

QLocale.MalayalamScript

QLocale.MandaeanScript

Since Qt 5.1

QLocale.ManichaeanScript

Since Qt 5.5

QLocale.MarchenScript

Since Qt 5.7

QLocale.MeiteiMayekScript

Since Qt 5.1

QLocale.MendeKikakuiScript

Since Qt 5.5

QLocale.MeroiticCursiveScript

Since Qt 5.1

QLocale.MeroiticScript

Since Qt 5.1

QLocale.ModiScript

Since Qt 5.5

QLocale.MongolianScript

QLocale.MroScript

Since Qt 5.5

QLocale.MultaniScript

Since Qt 5.7

QLocale.MyanmarScript

QLocale.NabataeanScript

Since Qt 5.5

QLocale.NewaScript

Since Qt 5.7

QLocale.NewTaiLueScript

Since Qt 5.1

QLocale.NkoScript

Since Qt 5.1

QLocale.OghamScript

Since Qt 5.1

QLocale.OlChikiScript

Since Qt 5.1

QLocale.OldHungarianScript

Since Qt 5.7

QLocale.OldItalicScript

Since Qt 5.1

QLocale.OldNorthArabianScript

Since Qt 5.5

QLocale.OldPermicScript

Since Qt 5.5

QLocale.OldPersianScript

Since Qt 5.1

QLocale.OldSouthArabianScript

Since Qt 5.1

QLocale.OriyaScript

QLocale.OrkhonScript

Since Qt 5.1

QLocale.OsageScript

Since Qt 5.7

QLocale.OsmanyaScript

Since Qt 5.1

QLocale.PahawhHmongScript

Since Qt 5.5

QLocale.PalmyreneScript

Since Qt 5.5

QLocale.PauCinHauScript

Since Qt 5.5

QLocale.PhagsPaScript

Since Qt 5.1

QLocale.PhoenicianScript

Since Qt 5.1

QLocale.PollardPhoneticScript

Since Qt 5.1

QLocale.PsalterPahlaviScript

Since Qt 5.5

QLocale.RejangScript

Since Qt 5.1

QLocale.RunicScript

Since Qt 5.1

QLocale.SamaritanScript

Since Qt 5.1

QLocale.SaurashtraScript

Since Qt 5.1

QLocale.SharadaScript

Since Qt 5.1

QLocale.ShavianScript

Since Qt 5.1

QLocale.SiddhamScript

Since Qt 5.5

QLocale.SignWritingScript

Since Qt 5.7

QLocale.SimplifiedChineseScript

如同

QLocale.SimplifiedHanScript

如同

QLocale.SinhalaScript

QLocale.SoraSompengScript

Since Qt 5.1

QLocale.SundaneseScript

Since Qt 5.1

QLocale.SylotiNagriScript

Since Qt 5.1

QLocale.SyriacScript

QLocale.TagalogScript

Since Qt 5.1

QLocale.TagbanwaScript

Since Qt 5.1

QLocale.TaiLeScript

Since Qt 5.1

QLocale.TaiVietScript

Since Qt 5.1

QLocale.TakriScript

Since Qt 5.1

QLocale.TamilScript

QLocale.TangutScript

Since Qt 5.7

QLocale.TeluguScript

QLocale.ThaanaScript

QLocale.ThaiScript

QLocale.TibetanScript

QLocale.TifinaghScript

QLocale.TirhutaScript

Since Qt 5.5

QLocale.TraditionalChineseScript

如同

QLocale.TraditionalHanScript

如同

QLocale.UgariticScript

Since Qt 5.1

QLocale.VaiScript

QLocale.VarangKshitiScript

Since Qt 5.5

QLocale.YiScript

New in version 4.8.

PySide2.QtCore.QLocale. Country

此枚举类型用于指定国家。

常量

描述

QLocale.AnyCountry

QLocale.Afghanistan

QLocale.AlandIslands

QLocale.Albania

QLocale.Algeria

QLocale.AmericanSamoa

QLocale.Andorra

QLocale.Angola

QLocale.Anguilla

QLocale.Antarctica

QLocale.AntiguaAndBarbuda

QLocale.Argentina

QLocale.Armenia

QLocale.Aruba

QLocale.AscensionIsland

QLocale.Australia

QLocale.Austria

QLocale.Azerbaijan

QLocale.Bahamas

QLocale.Bahrain

QLocale.Bangladesh

QLocale.Barbados

QLocale.Belarus

QLocale.Belgium

QLocale.Belize

QLocale.Benin

QLocale.Bermuda

QLocale.Bhutan

QLocale.Bolivia

QLocale.Bonaire

QLocale.BosniaAndHerzegowina

QLocale.Botswana

QLocale.BouvetIsland

QLocale.Brazil

QLocale.BritishIndianOceanTerritory

QLocale.BritishVirginIslands

QLocale.Brunei

QLocale.Bulgaria

QLocale.BurkinaFaso

QLocale.Burundi

QLocale.Cambodia

QLocale.Cameroon

QLocale.Canada

QLocale.CanaryIslands

QLocale.CapeVerde

QLocale.CaymanIslands

QLocale.CentralAfricanRepublic

QLocale.CeutaAndMelilla

QLocale.Chad

QLocale.Chile

QLocale.China

QLocale.ChristmasIsland

QLocale.ClippertonIsland

QLocale.CocosIslands

QLocale.Colombia

QLocale.Comoros

QLocale.CongoBrazzaville

QLocale.CongoKinshasa

QLocale.CookIslands

QLocale.CostaRica

QLocale.Croatia

QLocale.Cuba

QLocale.CuraSao

QLocale.Cyprus

QLocale.CzechRepublic

QLocale.DemocraticRepublicOfCongo

Obsolete, please use

QLocale.DemocraticRepublicOfKorea

Obsolete, please use

QLocale.Denmark

QLocale.DiegoGarcia

QLocale.Djibouti

QLocale.Dominica

QLocale.DominicanRepublic

QLocale.EastTimor

QLocale.Ecuador

QLocale.Egypt

QLocale.ElSalvador

QLocale.EquatorialGuinea

QLocale.Eritrea

QLocale.Estonia

QLocale.Ethiopia

QLocale.EuropeanUnion

Since Qt 5.7

QLocale.Europe

Since Qt 5.12

QLocale.FalklandIslands

QLocale.FaroeIslands

QLocale.Fiji

QLocale.Finland

QLocale.France

QLocale.FrenchGuiana

QLocale.FrenchPolynesia

QLocale.FrenchSouthernTerritories

QLocale.Gabon

QLocale.Gambia

QLocale.Georgia

QLocale.Germany

QLocale.Ghana

QLocale.Gibraltar

QLocale.Greece

QLocale.Greenland

QLocale.Grenada

QLocale.Guadeloupe

QLocale.Guam

QLocale.Guatemala

QLocale.Guernsey

QLocale.Guinea

QLocale.GuineaBissau

QLocale.Guyana

QLocale.Haiti

QLocale.HeardAndMcDonaldIslands

QLocale.Honduras

QLocale.HongKong

QLocale.Hungary

QLocale.Iceland

QLocale.India

QLocale.Indonesia

QLocale.Iran

QLocale.Iraq

QLocale.Ireland

QLocale.IsleOfMan

QLocale.Israel

QLocale.Italy

QLocale.IvoryCoast

QLocale.Jamaica

QLocale.Japan

QLocale.Jersey

QLocale.Jordan

QLocale.Kazakhstan

QLocale.Kenya

QLocale.Kiribati

QLocale.Kosovo

Since Qt 5.2

QLocale.Kuwait

QLocale.Kyrgyzstan

QLocale.Laos

QLocale.LatinAmerica

QLocale.LatinAmericaAndTheCaribbean

Obsolete, please use

QLocale.Latvia

QLocale.Lebanon

QLocale.Lesotho

QLocale.Liberia

QLocale.Libya

QLocale.Liechtenstein

QLocale.Lithuania

QLocale.Luxembourg

QLocale.Macau

QLocale.Macedonia

QLocale.Madagascar

QLocale.Malawi

QLocale.Malaysia

QLocale.Maldives

QLocale.Mali

QLocale.Malta

QLocale.MarshallIslands

QLocale.Martinique

QLocale.Mauritania

QLocale.Mauritius

QLocale.Mayotte

QLocale.Mexico

QLocale.Micronesia

QLocale.Moldova

QLocale.Monaco

QLocale.Mongolia

QLocale.Montenegro

QLocale.Montserrat

QLocale.Morocco

QLocale.Mozambique

QLocale.Myanmar

QLocale.Namibia

QLocale.NauruCountry

QLocale.Nepal

QLocale.Netherlands

QLocale.NewCaledonia

QLocale.NewZealand

QLocale.Nicaragua

QLocale.Niger

QLocale.Nigeria

QLocale.Niue

QLocale.NorfolkIsland

QLocale.NorthernMarianaIslands

QLocale.NorthKorea

QLocale.Norway

QLocale.Oman

QLocale.OutlyingOceania

Since Qt 5.7

QLocale.Pakistan

QLocale.Palau

QLocale.PalestinianTerritories

QLocale.Panama

QLocale.PapuaNewGuinea

QLocale.Paraguay

QLocale.PeoplesRepublicOfCongo

Obsolete, please use

QLocale.Peru

QLocale.Philippines

QLocale.Pitcairn

QLocale.Poland

QLocale.Portugal

QLocale.PuertoRico

QLocale.Qatar

QLocale.RepublicOfKorea

Obsolete, please use

QLocale.Reunion

QLocale.Romania

QLocale.RussianFederation

same as Russia

QLocale.Russia

如同

QLocale.Rwanda

QLocale.SaintBarthelemy

QLocale.SaintHelena

QLocale.SaintKittsAndNevis

QLocale.SaintLucia

QLocale.SaintMartin

QLocale.SaintPierreAndMiquelon

QLocale.SaintVincentAndTheGrenadines

QLocale.Samoa

QLocale.SanMarino

QLocale.SaoTomeAndPrincipe

QLocale.SaudiArabia

QLocale.Senegal

QLocale.Serbia

QLocale.Seychelles

QLocale.SierraLeone

QLocale.Singapore

QLocale.SintMaarten

QLocale.Slovakia

QLocale.Slovenia

QLocale.SolomonIslands

QLocale.Somalia

QLocale.SouthAfrica

QLocale.SouthGeorgiaAndTheSouthSandwichIslands

QLocale.SouthKorea

QLocale.SouthSudan

QLocale.Spain

QLocale.SriLanka

QLocale.Sudan

QLocale.Suriname

QLocale.SvalbardAndJanMayenIslands

QLocale.Swaziland

QLocale.Sweden

QLocale.Switzerland

QLocale.Syria

QLocale.SyrianArabRepublic

Obsolete, please use Syria

QLocale.Taiwan

QLocale.Tajikistan

QLocale.Tanzania

QLocale.Thailand

QLocale.Togo

QLocale.TokelauCountry

QLocale.Tokelau

Obsolete, please use

QLocale.Tonga

QLocale.TrinidadAndTobago

QLocale.TristanDaCunha

QLocale.Tunisia

QLocale.Turkey

QLocale.Turkmenistan

QLocale.TurksAndCaicosIslands

QLocale.TuvaluCountry

QLocale.Tuvalu

Obsolete, please use

QLocale.Uganda

QLocale.Ukraine

QLocale.UnitedArabEmirates

QLocale.UnitedKingdom

QLocale.UnitedStates

QLocale.UnitedStatesMinorOutlyingIslands

QLocale.UnitedStatesVirginIslands

QLocale.Uruguay

QLocale.Uzbekistan

QLocale.Vanuatu

QLocale.VaticanCityState

QLocale.Venezuela

QLocale.Vietnam

QLocale.WallisAndFutunaIslands

QLocale.WesternSahara

QLocale.World

Since Qt 5.12

QLocale.Yemen

QLocale.Zambia

QLocale.Zimbabwe

PySide2.QtCore.QLocale. MeasurementSystem

This enum defines which units are used for measurement.

常量

描述

QLocale.MetricSystem

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

QLocale.ImperialUSSystem

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

QLocale.ImperialUKSystem

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

QLocale.ImperialSystem

Provided for compatibility. Same as

PySide2.QtCore.QLocale. FormatType

This enum describes the types of format that can be used when converting QDate and QTime objects to strings.

常量

描述

QLocale.LongFormat

The long version of day and month names; for example, returning “January” as a month name.

QLocale.ShortFormat

The short version of day and month names; for example, returning “Jan” as a month name.

QLocale.NarrowFormat

A special version of day and month names for use when space is limited; for example, returning “J” as a month name. Note that the narrow format might contain the same text for different months and days or it can even be an empty string if the locale doesn’t support narrow names, so you should avoid using it for date formatting. Also, for the system locale this format is the same as .

PySide2.QtCore.QLocale. NumberOption

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

常量

描述

QLocale.DefaultNumberOptions

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

QLocale.OmitGroupSeparator

If this option is set, the number-to-string functions will not insert group separators in their return values. The default is to insert group separators.

QLocale.RejectGroupSeparator

If this option is set, the string-to-number functions will fail if they encounter group separators in their input. The default is to accept numbers containing correctly placed group separators.

QLocale.OmitLeadingZeroInExponent

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

QLocale.RejectLeadingZeroInExponent

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

QLocale.IncludeTrailingZeroesAfterDot

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

QLocale.RejectTrailingZeroesAfterDot

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

PySide2.QtCore.QLocale. FloatingPointPrecisionOption

This enum defines constants that can be given as precision to number() , number() ,和 toString() when converting floats or doubles, in order to express a variable number of digits as precision.

常量

描述

QLocale.FloatingPointShortest

The conversion algorithm will try to find the shortest accurate representation for the given number. “Accurate” means that you get the exact same number back from an inverse conversion on the generated string representation.

另请参阅

toString() QString QByteArray

New in version 5.7.

PySide2.QtCore.QLocale. CurrencySymbolFormat

Specifies the format of the currency symbol.

常量

描述

QLocale.CurrencyIsoCode

a ISO-4217 code of the currency.

QLocale.CurrencySymbol

a currency symbol.

QLocale.CurrencyDisplayName

a user readable name of the currency.

New in version 4.8.

PySide2.QtCore.QLocale. DataSizeFormat

Specifies the format for representation of data quantities.

常量

描述

QLocale.DataSizeIecFormat

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

QLocale.DataSizeTraditionalFormat

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

QLocale.DataSizeSIFormat

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

New in version 5.10.

PySide2.QtCore.QLocale. QuotationStyle

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

常量

描述

QLocale.StandardQuotation

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

QLocale.AlternateQuotation

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

另请参阅

quoteString()

New in version 4.8.

PySide2.QtCore.QLocale. amText ( )
返回类型

unicode

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

另请参阅

pmText()

PySide2.QtCore.QLocale. bcp47Name ( )
返回类型

unicode

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

不像 uiLanguages() the returned value of the represents the locale name of the QLocale data but not the language the user-interface should be in.

This function tries to conform the locale name to BCP47.

static PySide2.QtCore.QLocale. c ( )
返回类型

QLocale

返回 QLocale object initialized to the “C” locale.

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

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

另请参阅

system()

PySide2.QtCore.QLocale. collation ( )
返回类型

QLocale

Returns the locale to use for collation.

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

另请参阅

QCollator

static PySide2.QtCore.QLocale. countriesForLanguage ( lang )
参数

lang Language

返回类型

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

另请参阅

matchingLocales()

PySide2.QtCore.QLocale. country ( )
返回类型

Country

Returns the country of this locale.

static PySide2.QtCore.QLocale. countryToString ( country )
参数

country Country

返回类型

unicode

返回 QString containing the name of country .

PySide2.QtCore.QLocale. createSeparatedList ( strl )
参数

strl – 字符串列表

返回类型

unicode

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

PySide2.QtCore.QLocale. currencySymbol ( [ arg__1=CurrencySymbol ] )
参数

arg__1 CurrencySymbolFormat

返回类型

unicode

Returns a currency symbol according to the format .

PySide2.QtCore.QLocale. dateFormat ( [ format=LongFormat ] )
参数

format FormatType

返回类型

unicode

Returns the date format used for the current locale.

format is LongFormat the format will be a long version. Otherwise it uses a shorter version.

PySide2.QtCore.QLocale. dateTimeFormat ( [ format=LongFormat ] )
参数

format FormatType

返回类型

unicode

Returns the date time format used for the current locale.

format is ShortFormat the format will be a short version. Otherwise it uses a longer version.

PySide2.QtCore.QLocale. dayName ( arg__1 [ , format=LongFormat ] )
参数
返回类型

unicode

Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type .

PySide2.QtCore.QLocale. decimalPoint ( )
返回类型

QChar

Returns the decimal point character of this locale.

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

PySide2.QtCore.QLocale. exponential ( )
返回类型

QChar

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

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

另请参阅

toString(double, char, int)

PySide2.QtCore.QLocale. firstDayOfWeek ( )
返回类型

DayOfWeek

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

PySide2.QtCore.QLocale. formattedDataSize ( bytes [ , precision=2 [ , format=QLocale.DataSizeIecFormat ] ] )
参数
  • bytes qint64

  • precision int

  • format DataSizeFormats

返回类型

unicode

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

PySide2.QtCore.QLocale. groupSeparator ( )
返回类型

QChar

Returns the group separator character of this locale.

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

PySide2.QtCore.QLocale. language ( )
返回类型

Language

Returns the language of this locale.

static PySide2.QtCore.QLocale. languageToString ( language )
参数

language Language

返回类型

unicode

返回 QString containing the name of language .

static PySide2.QtCore.QLocale. matchingLocales ( language , script , country )
参数
返回类型

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

Getting a list of all locales: QList < QLocale > allLocales = ( AnyLanguage , AnyScript , AnyCountry );

Getting a list of locales suitable for Russia: QList < QLocale > locales = ( AnyLanguage , AnyScript , Russia );

PySide2.QtCore.QLocale. measurementSystem ( )
返回类型

MeasurementSystem

Returns the measurement system for the locale.

PySide2.QtCore.QLocale. monthName ( arg__1 [ , format=LongFormat ] )
参数
返回类型

unicode

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

PySide2.QtCore.QLocale. name ( )
返回类型

unicode

Returns the language and country of this locale as a string of the form “language_country”, where language is a lowercase, two-letter ISO 639 language code, and country is an uppercase, two- or three-letter ISO 3166 country code.

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

PySide2.QtCore.QLocale. nativeCountryName ( )
返回类型

unicode

Returns a native name of the country for the locale. For example “España” for Spanish/Spain locale.

PySide2.QtCore.QLocale. nativeLanguageName ( )
返回类型

unicode

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

PySide2.QtCore.QLocale. negativeSign ( )
返回类型

QChar

Returns the negative sign character of this locale.

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

PySide2.QtCore.QLocale. numberOptions ( )
返回类型

NumberOptions

Returns the options related to number conversions for this QLocale 实例。

By default, no options are set for the standard locales, except for the “C” locale, which has OmitGroupSeparator set by default.

PySide2.QtCore.QLocale. __ne__ ( other )
参数

other QLocale

返回类型

bool

返回 true QLocale object is not the same as the other locale specified; otherwise returns false .

PySide2.QtCore.QLocale. __eq__ ( other )
参数

other QLocale

返回类型

bool

返回 true QLocale object is the same as the other locale specified; otherwise returns false .

PySide2.QtCore.QLocale. percent ( )
返回类型

QChar

Returns the percent character of this locale.

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

另请参阅

toString()

PySide2.QtCore.QLocale. pmText ( )
返回类型

unicode

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

另请参阅

amText()

PySide2.QtCore.QLocale. positiveSign ( )
返回类型

QChar

Returns the positive sign character of this locale.

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

PySide2.QtCore.QLocale. quoteString ( str [ , style=StandardQuotation ] )
参数
返回类型

unicode

PySide2.QtCore.QLocale. quoteString ( str [ , style=StandardQuotation ] )
参数
返回类型

unicode

PySide2.QtCore.QLocale. script ( )
返回类型

Script

Returns the script of this locale.

static PySide2.QtCore.QLocale. scriptToString ( script )
参数

script Script

返回类型

unicode

返回 QString containing the name of script .

static PySide2.QtCore.QLocale. setDefault ( locale )
参数

locale QLocale

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

警告

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

另请参阅

system() c()

PySide2.QtCore.QLocale. setNumberOptions ( options )
参数

options NumberOptions

设置 options related to number conversions for this QLocale 实例。

另请参阅

numberOptions()

PySide2.QtCore.QLocale. standaloneDayName ( arg__1 [ , format=LongFormat ] )
参数
返回类型

unicode

Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on) that is used as a standalone text, in the format specified by type .

If the locale information does not specify the standalone day name then return value is the same as in dayName() .

PySide2.QtCore.QLocale. standaloneMonthName ( arg__1 [ , format=LongFormat ] )
参数
返回类型

unicode

Returns the localized name of month that is used as a standalone text, in the format specified by type .

If the locale information doesn’t specify the standalone month name then return value is the same as in monthName() .

PySide2.QtCore.QLocale. swap ( other )
参数

other QLocale

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

static PySide2.QtCore.QLocale. system ( )
返回类型

QLocale

返回 QLocale object initialized to the system locale.

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

另请参阅

c()

PySide2.QtCore.QLocale. textDirection ( )
返回类型

LayoutDirection

Returns the text direction of the language.

PySide2.QtCore.QLocale. timeFormat ( [ format=LongFormat ] )
参数

format FormatType

返回类型

unicode

Returns the time format used for the current locale.

format is LongFormat the format will be a long version. Otherwise it uses a shorter version.

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 ushort

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 uint

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 short

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 qulonglong

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 qlonglong

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( i , symbol , precision )
参数
  • i float

  • symbol – unicode

  • precision int

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 int

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 [ , symbol="" ] )
参数
  • arg__1 double

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( arg__1 , symbol , precision )
参数
  • arg__1 double

  • symbol – unicode

  • precision int

返回类型

unicode

PySide2.QtCore.QLocale. toCurrencyString ( i [ , symbol="" ] )
参数
  • i float

  • symbol – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toDate ( string [ , format=LongFormat ] )
参数
返回类型

QDate

PySide2.QtCore.QLocale. toDate ( string , format , cal )
参数
返回类型

QDate

PySide2.QtCore.QLocale. toDate ( string , format )
参数
  • string – unicode

  • format – unicode

返回类型

QDate

PySide2.QtCore.QLocale. toDate ( string , format , cal )
参数
  • string – unicode

  • format – unicode

  • cal QCalendar

返回类型

QDate

PySide2.QtCore.QLocale. toDateTime ( string [ , format=LongFormat ] )
参数
返回类型

QDateTime

PySide2.QtCore.QLocale. toDateTime ( string , format , cal )
参数
返回类型

QDateTime

PySide2.QtCore.QLocale. toDateTime ( string , format )
参数
  • string – unicode

  • format – unicode

返回类型

QDateTime

PySide2.QtCore.QLocale. toDateTime ( string , format , cal )
参数
  • string – unicode

  • format – unicode

  • cal QCalendar

返回类型

QDateTime

PySide2.QtCore.QLocale. toDouble ( s )
参数

s – unicode

返回类型

(float, bool ok)

PySide2.QtCore.QLocale. toFloat ( s )
参数

s – unicode

返回类型

(float, bool ok)

PySide2.QtCore.QLocale. toInt ( s )
参数

s – unicode

返回类型

(int, bool ok)

PySide2.QtCore.QLocale. toLong ( s [ , ok=None ] )
参数
  • s – unicode

  • ok bool

返回类型

long

PySide2.QtCore.QLocale. toLong ( s [ , ok=None ] )
参数
  • s QStringRef

  • ok bool

返回类型

long

PySide2.QtCore.QLocale. toLongLong ( s )
参数

s – unicode

返回类型

(int, bool ok)

PySide2.QtCore.QLocale. toLower ( str )
参数

str – unicode

返回类型

unicode

Returns a lowercase copy of str .

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

另请参阅

toLower()

PySide2.QtCore.QLocale. toShort ( s )
参数

s – unicode

返回类型

(int, bool ok)

PySide2.QtCore.QLocale. toString ( i )
参数

i int

返回类型

unicode

这是重载函数。

另请参阅

toInt()

PySide2.QtCore.QLocale. toString ( i )
参数

i long

返回类型

unicode

这是重载函数。

另请参阅

toLong()

PySide2.QtCore.QLocale. toString ( i )
参数

i qlonglong

返回类型

unicode

Returns a localized string representation of i .

PySide2.QtCore.QLocale. toString ( dateTime , format , cal )
参数
返回类型

unicode

PySide2.QtCore.QLocale. toString ( i )
参数

i short

返回类型

unicode

这是重载函数。

另请参阅

toShort()

PySide2.QtCore.QLocale. toString ( i )
参数

i ulong

返回类型

unicode

这是重载函数。

另请参阅

toULong()

PySide2.QtCore.QLocale. toString ( i [ , f='g' [ , prec=6 ] ] )
参数
  • i double

  • f char

  • prec int

返回类型

unicode

这是重载函数。

f and prec have the same meaning as in number (double, char, int).

PySide2.QtCore.QLocale. toString ( time , formatStr )
参数
  • time QTime

  • formatStr – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toString ( time [ , format=LongFormat ] )
参数
返回类型

unicode

PySide2.QtCore.QLocale. toString ( dateTime , format )
参数
返回类型

unicode

PySide2.QtCore.QLocale. toString ( dateTime [ , format=LongFormat ] )
参数
返回类型

unicode

PySide2.QtCore.QLocale. toString ( date , formatStr )
参数
  • date QDate

  • formatStr – unicode

返回类型

unicode

PySide2.QtCore.QLocale. toString ( date , format , cal )
参数
返回类型

unicode

PySide2.QtCore.QLocale. toString ( date [ , format=LongFormat ] )
参数
返回类型

unicode

PySide2.QtCore.QLocale. toString ( i [ , f='g' [ , prec=6 ] ] )
参数
  • i float

  • f char

  • prec int

返回类型

unicode

这是重载函数。

f and prec have the same meaning as in number (double, char, int).

另请参阅

toDouble()

PySide2.QtCore.QLocale. toTime ( string , format , cal )
参数
  • string – unicode

  • format – unicode

  • cal QCalendar

返回类型

QTime

注意

此函数被弃用。

PySide2.QtCore.QLocale. toTime ( string , format )
参数
  • string – unicode

  • format – unicode

返回类型

QTime

PySide2.QtCore.QLocale. toTime ( string , format , cal )
参数
返回类型

QTime

注意

此函数被弃用。

PySide2.QtCore.QLocale. toTime ( string [ , format=LongFormat ] )
参数
返回类型

QTime

PySide2.QtCore.QLocale. toUInt ( s )
参数

s – unicode

返回类型

(int, bool ok)

PySide2.QtCore.QLocale. toULong ( s [ , ok=None ] )
参数
  • s – unicode

  • ok bool

返回类型

ulong

PySide2.QtCore.QLocale. toULong ( s [ , ok=None ] )
参数
  • s QStringRef

  • ok bool

返回类型

ulong

PySide2.QtCore.QLocale. toULongLong ( s )
参数

s – unicode

返回类型

(int, bool ok)

PySide2.QtCore.QLocale. toUShort ( s )
参数

s – unicode

返回类型

(int, bool ok)

PySide2.QtCore.QLocale. toUpper ( str )
参数

str – unicode

返回类型

unicode

Returns an uppercase copy of str .

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

另请参阅

toUpper()

PySide2.QtCore.QLocale. uiLanguages ( )
返回类型

字符串列表

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

The return value represents locale names that the user expects to see the UI translation in.

Most like you do not need to use this function directly, but just pass the QLocale object to the load() 函数。

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

PySide2.QtCore.QLocale. weekdays ( )
返回类型

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

PySide2.QtCore.QLocale. zeroDigit ( )
返回类型

QChar

返回此区域设置的 0 数字字符。

注意

This function shall change to return a QString 而不是 QChar in Qt6. Callers are encouraged to exploit the QString ( QChar ) constructor to convert early in preparation for this.

另请参阅

toString()