QSystemLocale Class

The QSystemLocale class can be used to finetune the system locale of the user. 更多...

头: #include <QSystemLocale>
Since: Qt 4.2

公共类型

class CurrencyToStringArgument
enum QueryType { LanguageId, ScriptId, CountryId, DecimalPoint, ..., NativeCountryName }

公共函数

QSystemLocale ()
virtual ~QSystemLocale ()
virtual QLocale fallbackLocale () const
virtual QVariant query (QueryType type , QVariant in ) const

详细描述

The QSystemLocale class can be used to finetune the system locale of the user.

警告: This class is only useful in very rare cases. Usually QLocale offers all the functionality required for application development.

QSystemLocale allows to override the values provided by the system locale ( QLocale::system ()).

另请参阅 QLocale .

成员类型文档编制

enum QSystemLocale:: QueryType

Specifies the type of information queried by query (). For each value the type of information to return from the query () method is listed.

常量 描述
QSystemLocale::LanguageId 0 a uint specifying the language.
QSystemLocale::ScriptId 33 a uint specifying the script.
QSystemLocale::CountryId 1 a uint specifying the country.
QSystemLocale::DecimalPoint 2 a QString specifying the decimal point.
QSystemLocale::GroupSeparator 3 a QString specifying the group separator.
QSystemLocale::ZeroDigit 4 a QString specifying the zero digit.
QSystemLocale::NegativeSign 5 a QString specifying the minus sign.
QSystemLocale::PositiveSign 23 a QString specifying the plus sign.
QSystemLocale::DateFormatLong 6 a QString specifying the long date format
QSystemLocale::DateFormatShort 7 a QString specifying the short date format
QSystemLocale::TimeFormatLong 8 a QString specifying the long time format
QSystemLocale::TimeFormatShort 9 a QString specifying the short time format
QSystemLocale::DayNameLong 10 a QString specifying the name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
QSystemLocale::DayNameShort 11 a QString specifying the short name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
QSystemLocale::MonthNameLong 12 a QString specifying the name of a month. the in variant contains an integer between 1 and 12
QSystemLocale::MonthNameShort 13 a QString specifying the short name of a month. the in variant contains an integer between 1 and 12
QSystemLocale::DateToStringLong 14 converts the QDate stored in the in variant to a QString using the long date format
QSystemLocale::DateToStringShort 15 converts the QDate stored in the in variant to a QString using the short date format
QSystemLocale::TimeToStringLong 16 converts the QTime stored in the in variant to a QString using the long time format
QSystemLocale::TimeToStringShort 17 converts the QTime stored in the in variant to a QString using the short time format
QSystemLocale::DateTimeFormatLong 18 a QString specifying the long date time format
QSystemLocale::DateTimeFormatShort 19 a QString specifying the short date time format
QSystemLocale::DateTimeToStringLong 20 converts the QDateTime in the in variant to a QString using the long datetime format
QSystemLocale::DateTimeToStringShort 21 converts the QDateTime in the in variant to a QString using the short datetime format
QSystemLocale::MeasurementSystem 22 a QLocale::MeasurementSystem enum specifying the measurement system
QSystemLocale::AMText 24 a string that represents the system AM designator associated with a 12-hour clock.
QSystemLocale::PMText 25 a string that represents the system PM designator associated with a 12-hour clock.
QSystemLocale::FirstDayOfWeek 26 a Qt::DayOfWeek enum specifiying the first day of the week
QSystemLocale::CurrencySymbol 28 a string that represents a currency in a format QLocale::CurrencyFormat.
QSystemLocale::CurrencyToString 29 a localized string representation of a number with a currency symbol. Converts a QSystemLocale::CurrencyToStringArgument stored in the in variant to a QString .
QSystemLocale::UILanguages 30 a list of strings representing locale names that could be used for UI translation.
QSystemLocale::StringToStandardQuotation 31 a QString containing a quoted version of the string ref stored in the in variant using standard quotes.
QSystemLocale::StringToAlternateQuotation 32 a QString containing a quoted version of the string ref stored in the in variant using alternate quotes.
QSystemLocale::Weekdays 27 a QList < Qt::DayOfWeek > specifying the regular weekdays
QSystemLocale::LocaleChanged 35 this type is queried whenever the system locale is changed.
QSystemLocale::ListToSeparatedString 34 a string that represents a join of a given QStringList with a locale-defined separator.
QSystemLocale::NativeLanguageName 36 a string that represents the name of the native language.
QSystemLocale::NativeCountryName 37 a string that represents the name of the native country.

成员函数文档编制

QSystemLocale:: QSystemLocale ()

构造 QSystemLocale object. The constructor will automatically install this object as the system locale and remove any earlier installed system locales.

[虚拟] QSystemLocale:: ~QSystemLocale ()

Deletes the object.

[虚拟] QLocale QSystemLocale:: fallbackLocale () const

Returns the fallback locale obtained from the system.

该函数在 Qt 4.6 引入。

[虚拟] QVariant QSystemLocale:: query ( QueryType type , QVariant in ) const

Generic query method for locale data. Provides indirection. Denotes the type of the query with in as input data depending on the query.

另请参阅 QSystemLocale::QueryType .