Qt Reference Documentation

Contents

QSystemLocale Class Reference

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

 #include <QSystemLocale>

This class was introduced in Qt 4.2.

Public Types

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

Public Functions

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

Detailed Description

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

Warning: 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()).

See also QLocale.

Member Type Documentation

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.

ConstantValueDescription
QSystemLocale::LanguageId0a uint specifying the language.
QSystemLocale::ScriptId33a uint specifying the script.
QSystemLocale::CountryId1a uint specifying the country.
QSystemLocale::DecimalPoint2a QString specifying the decimal point.
QSystemLocale::GroupSeparator3a QString specifying the group separator.
QSystemLocale::ZeroDigit4a QString specifying the zero digit.
QSystemLocale::NegativeSign5a QString specifying the minus sign.
QSystemLocale::PositiveSign23a QString specifying the plus sign.
QSystemLocale::DateFormatLong6a QString specifying the long date format
QSystemLocale::DateFormatShort7a QString specifying the short date format
QSystemLocale::TimeFormatLong8a QString specifying the long time format
QSystemLocale::TimeFormatShort9a QString specifying the short time format
QSystemLocale::DayNameLong10a QString specifying the name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
QSystemLocale::DayNameShort11a QString specifying the short name of a weekday. the in variant contains an integer between 1 and 7 (Monday - Sunday)
QSystemLocale::MonthNameLong12a QString specifying the name of a month. the in variant contains an integer between 1 and 12
QSystemLocale::MonthNameShort13a QString specifying the short name of a month. the in variant contains an integer between 1 and 12
QSystemLocale::DateToStringLong14converts the QDate stored in the in variant to a QString using the long date format
QSystemLocale::DateToStringShort15converts the QDate stored in the in variant to a QString using the short date format
QSystemLocale::TimeToStringLong16converts the QTime stored in the in variant to a QString using the long time format
QSystemLocale::TimeToStringShort17converts the QTime stored in the in variant to a QString using the short time format
QSystemLocale::DateTimeFormatLong18a QString specifying the long date time format
QSystemLocale::DateTimeFormatShort19a QString specifying the short date time format
QSystemLocale::DateTimeToStringLong20converts the QDateTime in the in variant to a QString using the long datetime format
QSystemLocale::DateTimeToStringShort21converts the QDateTime in the in variant to a QString using the short datetime format
QSystemLocale::MeasurementSystem22a QLocale::MeasurementSystem enum specifying the measurement system
QSystemLocale::AMText24a string that represents the system AM designator associated with a 12-hour clock.
QSystemLocale::PMText25a string that represents the system PM designator associated with a 12-hour clock.
QSystemLocale::FirstDayOfWeek26a Qt::DayOfWeek enum specifiying the first day of the week
QSystemLocale::CurrencySymbol28a string that represents a currency in a format QLocale::CurrencyFormat.
QSystemLocale::CurrencyToString29a localized string representation of a number with a currency symbol. Converts a QSystemLocale::CurrencyToStringArgument stored in the in variant to a QString.
QSystemLocale::UILanguages30a list of strings representing locale names that could be used for UI translation.
QSystemLocale::StringToStandardQuotation31a QString containing a quoted version of the string ref stored in the in variant using standard quotes.
QSystemLocale::StringToAlternateQuotation32a QString containing a quoted version of the string ref stored in the in variant using alternate quotes.
QSystemLocale::Weekdays27a QList<Qt::DayOfWeek> specifying the regular weekdays
QSystemLocale::LocaleChanged35this type is queried whenever the system locale is changed.
QSystemLocale::ListToSeparatedString34a string that represents a join of a given QStringList with a locale-defined separator.
QSystemLocale::NativeLanguageName36a string that represents the name of the native language.
QSystemLocale::NativeCountryName37a string that represents the name of the native country.

Member Function Documentation

QSystemLocale::QSystemLocale ()

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

QSystemLocale::~QSystemLocale () [virtual]

Deletes the object.

QLocale QSystemLocale::fallbackLocale () const [virtual]

Returns the fallback locale obtained from the system.

This function was introduced in Qt 4.6.

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

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

See also QSystemLocale::QueryType.