Qt 4.8
|
#include <qlocale.h>
Classes | |
struct | Data |
Public Functions | |
QString | amText () const |
Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hour clock. More... | |
QString | bcp47Name () const |
Returns the dash-separated language, script and country (and possibly other BCP47 fields) of this locale as a string. More... | |
Country | country () const |
Returns the country of this locale. More... | |
QString | createSeparatedList (const QStringList &strl) const |
Returns a string that represents a join of a given list of strings with a separator defined by the locale. More... | |
QString | currencySymbol (CurrencySymbolFormat=CurrencySymbol) const |
Returns a currency symbol according to the format. More... | |
QString | dateFormat (FormatType format=LongFormat) const |
Returns the date format used for the current locale. More... | |
QString | dateTimeFormat (FormatType format=LongFormat) const |
Returns the date time format used for the current locale. More... | |
QString | dayName (int, FormatType format=LongFormat) const |
Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type. More... | |
QChar | decimalPoint () const |
Returns the decimal point character of this locale. More... | |
QChar | exponential () const |
Returns the exponential character of this locale. More... | |
Qt::DayOfWeek | firstDayOfWeek () const |
Returns the first day of the week according to the current locale. More... | |
QChar | groupSeparator () const |
Returns the group separator character of this locale. More... | |
Language | language () const |
Returns the language of this locale. More... | |
MeasurementSystem | measurementSystem () const |
Returns the measurement system for the locale. More... | |
QString | monthName (int, FormatType format=LongFormat) const |
Returns the localized name of month, in the format specified by type. More... | |
QString | name () const |
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. More... | |
QString | nativeCountryName () const |
Returns a native name of the country for the locale. More... | |
QString | nativeLanguageName () const |
Returns a native name of the language for the locale. More... | |
QChar | negativeSign () const |
Returns the negative sign character of this locale. More... | |
NumberOptions | numberOptions () const |
Returns the options related to number conversions for this QLocale instance. More... | |
bool | operator!= (const QLocale &other) const |
QLocale & | operator= (const QLocale &other) |
Assigns other to this QLocale object and returns a reference to this QLocale object. More... | |
bool | operator== (const QLocale &other) const |
QChar | percent () const |
Returns the percent character of this locale. More... | |
QString | pmText () const |
Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hour clock. More... | |
QChar | positiveSign () const |
Returns the positive sign character of this locale. More... | |
QLocale () | |
Constructs a QLocale object initialized with the default locale. More... | |
QLocale (const QString &name) | |
Constructs a QLocale object with the specified name, which has the format "language[_script][_country][.codeset][@modifier]" or "C", where: More... | |
QLocale (Language language, Country country=AnyCountry) | |
Constructs a QLocale object with the specified language and country. More... | |
QLocale (Language language, Script script, Country country) | |
Constructs a QLocale object with the specified language, script and country. More... | |
QLocale (const QLocale &other) | |
Constructs a QLocale object as a copy of other. More... | |
QString | quoteString (const QString &str, QuotationStyle style=StandardQuotation) const |
Returns str quoted according to the current locale using the given quotation style. More... | |
QString | quoteString (const QStringRef &str, QuotationStyle style=StandardQuotation) const |
Script | script () const |
Returns the script of this locale. More... | |
void | setNumberOptions (NumberOptions options) |
Sets the options related to number conversions for this QLocale instance. More... | |
QString | standaloneDayName (int, FormatType format=LongFormat) const |
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. More... | |
QString | standaloneMonthName (int, FormatType format=LongFormat) const |
Returns the localized name of month that is used as a standalone text, in the format specified by type. More... | |
Qt::LayoutDirection | textDirection () const |
Returns the text direction of the language. More... | |
QString | timeFormat (FormatType format=LongFormat) const |
Returns the time format used for the current locale. More... | |
QString | toCurrencyString (qlonglong, const QString &symbol=QString()) const |
Returns a localized string representation of value as a currency. More... | |
QString | toCurrencyString (qulonglong, const QString &symbol=QString()) const |
QString | toCurrencyString (short, const QString &symbol=QString()) const |
QString | toCurrencyString (ushort, const QString &symbol=QString()) const |
QString | toCurrencyString (int, const QString &symbol=QString()) const |
QString | toCurrencyString (uint, const QString &symbol=QString()) const |
QString | toCurrencyString (double, const QString &symbol=QString()) const |
QString | toCurrencyString (float, const QString &symbol=QString()) const |
QDate | toDate (const QString &string, FormatType=LongFormat) const |
Parses the date string given in string and returns the date. More... | |
QDate | toDate (const QString &string, const QString &format) const |
Parses the date string given in string and returns the date. More... | |
QDateTime | toDateTime (const QString &string, FormatType format=LongFormat) const |
Parses the date/time string given in string and returns the time. More... | |
QDateTime | toDateTime (const QString &string, const QString &format) const |
Parses the date/time string given in string and returns the time. More... | |
double | toDouble (const QString &s, bool *ok=0) const |
Returns the double represented by the localized string s, or 0.0 if the conversion failed. More... | |
float | toFloat (const QString &s, bool *ok=0) const |
int | toInt (const QString &s, bool *ok=0, int base=0) const |
Returns the int represented by the localized string s, using base base. More... | |
qlonglong | toLongLong (const QString &s, bool *ok=0, int base=0) const |
Returns the long long int represented by the localized string s, using base base. More... | |
QString | toLower (const QString &str) const |
Returns a lowercase copy of str. More... | |
short | toShort (const QString &s, bool *ok=0, int base=0) const |
Returns the short int represented by the localized string s, using base base. More... | |
QString | toString (qlonglong i) const |
Returns a localized string representation of i. More... | |
QString | toString (qulonglong i) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
QString | toString (short i) const |
QString | toString (ushort i) const |
QString | toString (int i) const |
QString | toString (uint i) const |
QString | toString (double i, char f='g', int prec=6) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.f and prec have the same meaning as in QString::number(double, char, int). More... | |
QString | toString (float i, char f='g', int prec=6) const |
QString | toString (const QDate &date, const QString &formatStr) const |
Returns a localized string representation of the given date in the specified format. More... | |
QString | toString (const QDate &date, FormatType format=LongFormat) const |
Returns a localized string representation of the given date according to the specified format. More... | |
QString | toString (const QTime &time, const QString &formatStr) const |
Returns a localized string representation of the given time according to the specified format. More... | |
QString | toString (const QTime &time, FormatType format=LongFormat) const |
Returns a localized string representation of the given time in the specified format. More... | |
QString | toString (const QDateTime &dateTime, FormatType format=LongFormat) const |
Returns a localized string representation of the given dateTime according to the specified format. More... | |
QString | toString (const QDateTime &dateTime, const QString &format) const |
Returns a localized string representation of the given dateTime according to the specified format. More... | |
QTime | toTime (const QString &string, FormatType=LongFormat) const |
Parses the time string given in string and returns the time. More... | |
QTime | toTime (const QString &string, const QString &format) const |
Parses the time string given in string and returns the time. More... | |
uint | toUInt (const QString &s, bool *ok=0, int base=0) const |
Returns the unsigned int represented by the localized string s, using base base. More... | |
qlonglong | toULongLong (const QString &s, bool *ok=0, int base=0) const |
Returns the unsigned long long int represented by the localized string s, using base base. More... | |
QString | toUpper (const QString &str) const |
Returns an uppercase copy of str. More... | |
ushort | toUShort (const QString &s, bool *ok=0, int base=0) const |
Returns the unsigned short int represented by the localized string s, using base base. More... | |
QStringList | uiLanguages () const |
Returns an ordered list of locale names for translation purposes in preference order. More... | |
QList< Qt::DayOfWeek > | weekdays () const |
Returns a list of days that are considered weekdays according to the current locale. More... | |
QChar | zeroDigit () const |
Returns the zero digit character of this locale. More... | |
Static Public Functions | |
static QLocale | c () |
Returns a QLocale object initialized to the "C" locale. More... | |
static QList< Country > | countriesForLanguage (Language lang) |
Returns the list of countries that have entires for language in Qt's locale database. More... | |
static QString | countryToString (Country country) |
Returns a QString containing the name of country. More... | |
static QString | languageToString (Language language) |
Returns a QString containing the name of language. More... | |
static QList< QLocale > | matchingLocales (QLocale::Language language, QLocale::Script script, QLocale::Country country) |
Returns a list of valid locale objects that match the given language, script and country. More... | |
static QString | scriptToString (Script script) |
Returns a QString containing the name of script. More... | |
static void | setDefault (const QLocale &locale) |
Sets the global default locale to locale. More... | |
static QLocale | system () |
Returns a QLocale object initialized to the system locale. More... | |
Private Functions | |
const QLocalePrivate * | d () const |
Properties | |
union { | |
Data p | |
void * v | |
}; | |
Friends | |
class | QByteArray |
class | QDoubleValidatorPrivate |
class | QIntValidator |
struct | QLocalePrivate |
class | QString |
class | QTextStream |
class | QTextStreamPrivate |
enum QLocale::Country |
Definition at line 405 of file qlocale.h.
Specifies the format of the currency symbol.
Enumerator | |
---|---|
CurrencyIsoCode | |
CurrencySymbol | |
CurrencyDisplayName |
enum QLocale::FormatType |
Enumerator | |
---|---|
LongFormat | |
ShortFormat | |
NarrowFormat |
enum QLocale::Language |
Definition at line 148 of file qlocale.h.
Enumerator | |
---|---|
MetricSystem | |
ImperialSystem |
Definition at line 657 of file qlocale.h.
Enumerator | |
---|---|
OmitGroupSeparator | |
RejectGroupSeparator |
Definition at line 660 of file qlocale.h.
Enumerator | |
---|---|
StandardQuotation | |
AlternateQuotation |
Definition at line 782 of file qlocale.h.
enum QLocale::Script |
Definition at line 390 of file qlocale.h.
QLocale::QLocale | ( | ) |
Constructs a QLocale object initialized with the default locale.
If no default locale was set using setDefaultLocale(), this locale will be the same as the one returned by system().
Definition at line 669 of file qlocale.cpp.
QLocale::QLocale | ( | const QString & | name | ) |
Constructs a QLocale object with the specified name, which has the format "language[_script][_country][.codeset][@modifier]" or "C", where:
The separator can be either underscore or a minus sign.
If the string violates the locale format, or language is not a valid ISO 369 code, the "C" locale is used instead. If country is not present, or is not a valid ISO 3166 code, the most appropriate country is chosen for the specified language.
The language, script and country codes are converted to their respective Language
, Script
and Country
enums. After this conversion is performed the constructor behaves exactly like QLocale(Country, Script, Language).
This constructor is much slower than QLocale(Country, Script, Language).
Definition at line 654 of file qlocale.cpp.
QLocale::QLocale | ( | Language | language, |
Country | country = AnyCountry |
||
) |
Constructs a QLocale object with the specified language and country.
AnyCountry
, the language is used with the most appropriate available country (for example, Germany for German), The language and country that are actually used can be queried using language() and country().
Definition at line 695 of file qlocale.cpp.
Constructs a QLocale object with the specified language, script and country.
The language, script and country that are actually used can be queried using language(), script() and country().
Definition at line 737 of file qlocale.cpp.
QLocale::QLocale | ( | const QLocale & | other | ) |
Constructs a QLocale object as a copy of other.
Definition at line 756 of file qlocale.cpp.
QString QLocale::amText | ( | ) | const |
Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hour clock.
Definition at line 2353 of file qlocale.cpp.
Referenced by QLocalePrivate::dateTimeToString(), and QSystemLocale::query().
QString QLocale::bcp47Name | ( | ) | const |
Returns the dash-separated language, script and country (and possibly other BCP47 fields) of this locale as a string.
Unlike the uiLanguages() the returned value of the bcp47Name() 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.
Definition at line 1012 of file qlocale.cpp.
Referenced by qt_u_strToCase(), setDefault(), and uiLanguages().
|
inlinestatic |
Returns a QLocale object initialized to the "C" locale.
Definition at line 773 of file qlocale.h.
Referenced by _q_parseDosDir(), _q_parseUnixDir(), QString::arg(), QLocalePrivate::dateTimeToString(), QNetworkHeadersPrivate::fromHttpDate(), QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), QApplication::keyboardInputLocale(), QBBSystemLocaleData::languageLocale(), name(), QTextStreamPrivate::putNumber(), q_getKeyboardLocale(), qToLower(), QBBSystemLocaleData::regionLocale(), QNetworkHeadersPrivate::toHttpDate(), QNetworkCookie::toRawForm(), QLocalePrivate::validateChars(), and QKeyMapperPrivate::~QKeyMapperPrivate().
|
static |
Returns the list of countries that have entires for language in Qt's locale database.
If the result is an empty list, then language is not represented in Qt's locale database.
Definition at line 1974 of file qlocale.cpp.
QLocale::Country QLocale::country | ( | ) | const |
Returns the country of this locale.
Definition at line 945 of file qlocale.cpp.
Referenced by QResourceRoot::findNode(), and QSystemLocale::query().
Returns a QString containing the name of country.
Definition at line 1036 of file qlocale.cpp.
QString QLocale::createSeparatedList | ( | const QStringList & | list | ) | const |
Returns a string that represents a join of a given list of strings with a separator defined by the locale.
Definition at line 855 of file qlocale.cpp.
QString QLocale::currencySymbol | ( | QLocale::CurrencySymbolFormat | format = CurrencySymbol | ) | const |
Returns a currency symbol according to the format.
Definition at line 3267 of file qlocale.cpp.
Referenced by toCurrencyString().
|
private |
Definition at line 761 of file qlocale.cpp.
Referenced by amText(), QString::arg(), bcp47Name(), QLocalePrivate::bytearrayToDouble(), countriesForLanguage(), country(), createSeparatedList(), currencySymbol(), dateFormat(), dateTimeFormat(), dayName(), decimalPoint(), exponential(), firstDayOfWeek(), QIntValidator::fixup(), groupSeparator(), language(), matchingLocales(), measurementSystem(), monthName(), name(), nativeCountryName(), nativeLanguageName(), negativeSign(), operator!=(), operator==(), percent(), pmText(), positiveSign(), QTextStreamPrivate::putNumber(), QLocale(), quoteString(), script(), setDefault(), QByteArray::setNum(), QString::setNum(), standaloneDayName(), standaloneMonthName(), timeFormat(), toCurrencyString(), QString::toDouble(), toDouble(), toFloat(), QString::toLongLong(), toLongLong(), toString(), QString::toULongLong(), toULongLong(), uiLanguages(), QLocalePrivate::updateSystemPrivate(), QIntValidator::validate(), QDoubleValidatorPrivate::validateWithLocale(), QString::vsprintf(), weekdays(), and zeroDigit().
QString QLocale::dateFormat | ( | FormatType | format = LongFormat | ) | const |
Returns the date format used for the current locale.
If format is LongFormat the format will be a long version. Otherwise it uses a shorter version.
Definition at line 1495 of file qlocale.cpp.
Referenced by dateTimeFormat(), QSystemLocale::query(), QDateTimeEditPrivate::readLocaleSettings(), toDate(), and toString().
QString QLocale::dateTimeFormat | ( | FormatType | format = LongFormat | ) | const |
Returns the date time format used for the current locale.
If format is ShortFormat the format will be a short version. Otherwise it uses a longer version.
Definition at line 1575 of file qlocale.cpp.
Referenced by QDateTimeEditPrivate::readLocaleSettings(), toDateTime(), and toString().
QString QLocale::dayName | ( | int | day, |
FormatType | type = LongFormat |
||
) | const |
Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type.
Definition at line 2106 of file qlocale.cpp.
Referenced by QLocalePrivate::dateTimeToString(), QCalendarModel::dayName(), QDateTimeParser::findDay(), QDate::longDayName(), QSystemLocale::query(), QDateTimeParser::sectionMaxSize(), QDate::shortDayName(), standaloneDayName(), and QCalendarDayValidator::text().
QChar QLocale::decimalPoint | ( | ) | const |
Returns the decimal point character of this locale.
Definition at line 1765 of file qlocale.cpp.
Referenced by QTextStreamPrivate::getReal(), QSystemLocale::query(), and QDoubleSpinBoxPrivate::validateAndInterpret().
QChar QLocale::exponential | ( | ) | const |
Returns the exponential character of this locale.
Definition at line 1843 of file qlocale.cpp.
Referenced by QLocalePrivate::doubleToString(), and QTextStreamPrivate::getReal().
Qt::DayOfWeek QLocale::firstDayOfWeek | ( | ) | const |
Returns the first day of the week according to the current locale.
Definition at line 2206 of file qlocale.cpp.
QChar QLocale::groupSeparator | ( | ) | const |
Returns the group separator character of this locale.
Definition at line 1778 of file qlocale.cpp.
Referenced by QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), QSystemLocale::query(), QSpinBoxPrivate::validateAndInterpret(), and QDoubleSpinBoxPrivate::validateAndInterpret().
QLocale::Language QLocale::language | ( | ) | const |
Returns the language of this locale.
Definition at line 920 of file qlocale.cpp.
Referenced by countriesForLanguage(), QResourceRoot::findNode(), matchingLocales(), QSystemLocale::query(), and textDirection().
Returns a QString containing the name of language.
Definition at line 1023 of file qlocale.cpp.
|
static |
Returns a list of valid locale objects that match the given language, script and country.
Getting a list of all locales: QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
Definition at line 1937 of file qlocale.cpp.
QLocale::MeasurementSystem QLocale::measurementSystem | ( | ) | const |
Returns the measurement system for the locale.
Definition at line 2265 of file qlocale.cpp.
Referenced by QPageSetupWidget::QPageSetupWidget(), and QPageSetupWidget::selectPrinter().
QString QLocale::monthName | ( | int | month, |
FormatType | type = LongFormat |
||
) | const |
Returns the localized name of month, in the format specified by type.
Definition at line 2007 of file qlocale.cpp.
Referenced by QLocalePrivate::dateTimeToString(), QDateTimeParser::findMonth(), QDate::longMonthName(), QSystemLocale::query(), QDateTimeParser::sectionMaxSize(), QDate::shortMonthName(), and standaloneMonthName().
QString QLocale::name | ( | ) | const |
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, name() will not contain it for compatibility reasons. Use bcp47Name() instead if you need a full locale name.
Definition at line 963 of file qlocale.cpp.
Referenced by QTextCodec::canEncode(), QSvgSwitch::init(), operator<<(), QHttpNetworkConnectionPrivate::prepareRequest(), standaloneDayName(), and standaloneMonthName().
QString QLocale::nativeCountryName | ( | ) | const |
Returns a native name of the country for the locale.
For example "España" for Spanish/Spain locale.
Definition at line 3459 of file qlocale.cpp.
QString QLocale::nativeLanguageName | ( | ) | const |
Returns a native name of the language for the locale.
For example "Schwiizertüütsch" for Swiss-German locale.
Definition at line 3436 of file qlocale.cpp.
QChar QLocale::negativeSign | ( | ) | const |
Returns the negative sign character of this locale.
Definition at line 1817 of file qlocale.cpp.
Referenced by QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), QTextStreamPrivate::putNumber(), QTextStreamPrivate::putString(), and QSystemLocale::query().
QLocale::NumberOptions QLocale::numberOptions | ( | ) | const |
Returns the options related to number conversions for this QLocale instance.
By default, no options are set for the standard locales.
Definition at line 802 of file qlocale.cpp.
Referenced by QString::arg(), operator!=(), operator==(), and setDefault().
|
inline |
Definition at line 822 of file qlocale.h.
Assigns other to this QLocale object and returns a reference to this QLocale object.
Definition at line 771 of file qlocale.cpp.
|
inline |
Definition at line 820 of file qlocale.h.
QChar QLocale::percent | ( | ) | const |
Returns the percent character of this locale.
Definition at line 1791 of file qlocale.cpp.
Referenced by QLocalePrivate::numberToCLocale().
QString QLocale::pmText | ( | ) | const |
Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hour clock.
Definition at line 2376 of file qlocale.cpp.
Referenced by QLocalePrivate::dateTimeToString(), and QSystemLocale::query().
QChar QLocale::positiveSign | ( | ) | const |
Returns the positive sign character of this locale.
Definition at line 1830 of file qlocale.cpp.
Referenced by QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), QTextStreamPrivate::putString(), and QSystemLocale::query().
QString QLocale::quoteString | ( | const QString & | str, |
QuotationStyle | style = StandardQuotation |
||
) | const |
Returns str quoted according to the current locale using the given quotation style.
Definition at line 816 of file qlocale.cpp.
QString QLocale::quoteString | ( | const QStringRef & | str, |
QuotationStyle | style = StandardQuotation |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 826 of file qlocale.cpp.
QLocale::Script QLocale::script | ( | ) | const |
Returns the script of this locale.
Definition at line 935 of file qlocale.cpp.
|
static |
Returns a QString containing the name of script.
Definition at line 1053 of file qlocale.cpp.
|
static |
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.
Definition at line 905 of file qlocale.cpp.
void QLocale::setNumberOptions | ( | NumberOptions | options | ) |
Sets the options related to number conversions for this QLocale instance.
Definition at line 786 of file qlocale.cpp.
Referenced by QAbstractItemViewPrivate::viewOptionsV4().
QString QLocale::standaloneDayName | ( | int | day, |
FormatType | type = LongFormat |
||
) | const |
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().
Definition at line 2158 of file qlocale.cpp.
Referenced by QCalendarModel::dayName(), QDate::longDayName(), and QDate::shortDayName().
QString QLocale::standaloneMonthName | ( | int | month, |
FormatType | type = LongFormat |
||
) | const |
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().
Definition at line 2056 of file qlocale.cpp.
Referenced by QDate::longMonthName(), QCalendarWidget::minimumSizeHint(), QSystemLocale::query(), QDate::shortMonthName(), and QCalendarMonthValidator::text().
|
static |
Returns a 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.
Definition at line 1917 of file qlocale.cpp.
Referenced by QTextCodec::canEncode(), QDate::fromString(), QTime::fromString(), QDateTime::fromString(), QDate::longDayName(), QDate::longMonthName(), QHttpNetworkConnectionPrivate::prepareRequest(), QDateTimeParser::QDateTimeParser(), QPageSetupWidget::QPageSetupWidget(), QPageSetupWidget::selectPrinter(), QDate::shortDayName(), QDate::shortMonthName(), QDate::toString(), and QTime::toString().
Qt::LayoutDirection QLocale::textDirection | ( | ) | const |
Returns the text direction of the language.
Definition at line 2286 of file qlocale.cpp.
Referenced by QXIMInputContext::QXIMInputContext().
QString QLocale::timeFormat | ( | FormatType | format = LongFormat | ) | const |
Returns the time format used for the current locale.
If format is LongFormat the format will be a long version. Otherwise it uses a shorter version.
Definition at line 1535 of file qlocale.cpp.
Referenced by dateTimeFormat(), QDateTimeEditPrivate::readLocaleSettings(), toString(), and toTime().
Returns a localized string representation of value as a currency.
If the symbol is provided it is used instead of the default currency symbol.
Definition at line 3309 of file qlocale.cpp.
QString QLocale::toCurrencyString | ( | qulonglong | value, |
const QString & | symbol = QString() |
||
) | const |
Definition at line 3339 of file qlocale.cpp.
Definition at line 825 of file qlocale.h.
Definition at line 827 of file qlocale.h.
Definition at line 829 of file qlocale.h.
Definition at line 831 of file qlocale.h.
Definition at line 3364 of file qlocale.cpp.
Definition at line 833 of file qlocale.h.
QDate QLocale::toDate | ( | const QString & | string, |
FormatType | format = LongFormat |
||
) | const |
Parses the date string given in string and returns the date.
The format of the date string is chosen according to the format parameter (see dateFormat()).
If the date could not be parsed, returns an invalid date.
Definition at line 1627 of file qlocale.cpp.
Parses the date string given in string and returns the date.
See QDate::fromString() for information on the expressions that can be used with this function.
This function searches month names and the names of the days of the week in the current locale.
If the date could not be parsed, returns an invalid date.
Definition at line 1704 of file qlocale.cpp.
QDateTime QLocale::toDateTime | ( | const QString & | string, |
FormatType | format = LongFormat |
||
) | const |
Parses the date/time string given in string and returns the time.
The format of the date/time string is chosen according to the format parameter (see dateTimeFormat()).
If the string could not be parsed, returns an invalid QDateTime.
Definition at line 1649 of file qlocale.cpp.
Referenced by _q_parseDosDir(), _q_parseUnixDir(), and QNetworkHeadersPrivate::fromHttpDate().
Parses the date/time string given in string and returns the time.
See QDateTime::fromString() for information on the expressions that can be used with this function.
If the string could not be parsed, returns an invalid QDateTime.
Definition at line 1738 of file qlocale.cpp.
double QLocale::toDouble | ( | const QString & | s, |
bool * | ok = 0 |
||
) | const |
Returns the double represented by the localized string s, or 0.0 if the conversion failed.
If ok is not 0, reports failure by setting ok to false and success by setting *ok to true.
Unlike QString::toDouble(), this function does not fall back to the "C" locale if the string cannot be interpreted in this locale.
Notice that the last conversion returns 1234.0, because '.' is the thousands group separator in the German locale.
This function ignores leading and trailing whitespace.
Definition at line 1279 of file qlocale.cpp.
Referenced by QTextStreamPrivate::getReal(), toFloat(), and QDoubleSpinBoxPrivate::validateAndInterpret().
float QLocale::toFloat | ( | const QString & | s, |
bool * | ok = 0 |
||
) | const |
Definition at line 1244 of file qlocale.cpp.
int QLocale::toInt | ( | const QString & | s, |
bool * | ok = 0 , |
||
int | base = 0 |
||
) | const |
Returns the int represented by the localized string s, using base base.
If base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal.
If the conversion fails the function returns 0.
If ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.
This function ignores leading and trailing whitespace.
Definition at line 1133 of file qlocale.cpp.
Referenced by QIntValidator::validate(), and QSpinBoxPrivate::validateAndInterpret().
Returns the long long int represented by the localized string s, using base base.
If base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal.
If the conversion fails the function returns 0.
If ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.
This function ignores leading and trailing whitespace.
Definition at line 1190 of file qlocale.cpp.
Referenced by toInt(), and toShort().
Returns a lowercase copy of str.
Definition at line 2328 of file qlocale.cpp.
short QLocale::toShort | ( | const QString & | s, |
bool * | ok = 0 , |
||
int | base = 0 |
||
) | const |
Returns the short int represented by the localized string s, using base base.
If base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal.
If the conversion fails the function returns 0.
If ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.
This function ignores leading and trailing whitespace.
Definition at line 1077 of file qlocale.cpp.
Returns a localized string representation of i.
Definition at line 1295 of file qlocale.cpp.
Referenced by QStyledItemDelegate::displayText(), QIntValidator::fixup(), QSystemLocale::query(), QDateTimeEdit::textFromDateTime(), QSpinBox::textFromValue(), QDoubleSpinBox::textFromValue(), QNetworkHeadersPrivate::toHttpDate(), QNetworkCookie::toRawForm(), QDate::toString(), QTime::toString(), toString(), and QItemDelegatePrivate::valueToText().
QString QLocale::toString | ( | qulonglong | i | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1310 of file qlocale.cpp.
|
inline |
Definition at line 810 of file qlocale.h.
Definition at line 812 of file qlocale.h.
|
inline |
Definition at line 814 of file qlocale.h.
Definition at line 816 of file qlocale.h.
QString QLocale::toString | ( | double | i, |
char | f = 'g' , |
||
int | prec = 6 |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.f and prec have the same meaning as in QString::number(double, char, int).
Definition at line 1869 of file qlocale.cpp.
|
inline |
Definition at line 818 of file qlocale.h.
Returns a localized string representation of the given date in the specified format.
If format is an empty string, an empty string is returned.
Definition at line 1325 of file qlocale.cpp.
QString QLocale::toString | ( | const QDate & | date, |
FormatType | format = LongFormat |
||
) | const |
Returns a localized string representation of the given date according to the specified format.
Definition at line 1335 of file qlocale.cpp.
Returns a localized string representation of the given time according to the specified format.
If format is an empty string, an empty string is returned.
Definition at line 1403 of file qlocale.cpp.
QString QLocale::toString | ( | const QTime & | time, |
FormatType | format = LongFormat |
||
) | const |
Returns a localized string representation of the given time in the specified format.
Definition at line 1462 of file qlocale.cpp.
QString QLocale::toString | ( | const QDateTime & | dateTime, |
FormatType | format = LongFormat |
||
) | const |
Returns a localized string representation of the given dateTime according to the specified format.
Definition at line 1436 of file qlocale.cpp.
Returns a localized string representation of the given dateTime according to the specified format.
If format is an empty string, an empty string is returned.
Definition at line 1419 of file qlocale.cpp.
QTime QLocale::toTime | ( | const QString & | string, |
FormatType | format = LongFormat |
||
) | const |
Parses the time string given in string and returns the time.
The format of the time string is chosen according to the format parameter (see timeFormat()).
If the time could not be parsed, returns an invalid time.
Definition at line 1606 of file qlocale.cpp.
Parses the time string given in string and returns the time.
See QTime::fromString() for information on what is a valid format string.
If the time could not be parsed, returns an invalid time.
Definition at line 1670 of file qlocale.cpp.
Returns the unsigned int represented by the localized string s, using base base.
If base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal.
If the conversion fails the function returns 0.
If ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.
This function ignores leading and trailing whitespace.
Definition at line 1161 of file qlocale.cpp.
Referenced by QDateTimeParser::parseSection().
Returns the unsigned long long int represented by the localized string s, using base base.
If base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal.
If the conversion fails the function returns 0.
If ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.
This function ignores leading and trailing whitespace.
Definition at line 1220 of file qlocale.cpp.
Referenced by toUInt(), and toUShort().
Returns an uppercase copy of str.
Definition at line 2307 of file qlocale.cpp.
Returns the unsigned short int represented by the localized string s, using base base.
If base is 0 the base is determined automatically using the following rules: If the string begins with "0x", it is assumed to be hexadecimal; if it begins with "0", it is assumed to be octal; otherwise it is assumed to be decimal.
If the conversion fails the function returns 0.
If ok is not 0, failure is reported by setting *ok to false, and success by setting *ok to true.
This function ignores leading and trailing whitespace.
Definition at line 1105 of file qlocale.cpp.
QStringList QLocale::uiLanguages | ( | ) | const |
Returns an ordered list of locale names for translation purposes in preference order.
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 QTranslator::load() function.
The first item in the list is the most preferred one.
Definition at line 3410 of file qlocale.cpp.
Referenced by find_translation().
QList< Qt::DayOfWeek > QLocale::weekdays | ( | ) | const |
Returns a list of days that are considered weekdays according to the current locale.
Definition at line 2237 of file qlocale.cpp.
QChar QLocale::zeroDigit | ( | ) | const |
Returns the zero digit character of this locale.
Definition at line 1804 of file qlocale.cpp.
Referenced by QSystemLocale::query().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 138 of file qlocale.h.
Referenced by createSeparatedList(), currencySymbol(), QLocalePrivate::dateTimeToString(), dayName(), monthName(), name(), standaloneDayName(), standaloneMonthName(), timeZone(), and toString().
|
friend |
|
friend |
union { ... } |
Data QLocale::p |
Definition at line 803 of file qlocale.h.
Referenced by d(), matchingLocales(), numberOptions(), QLocale(), setNumberOptions(), system(), toDouble(), toLongLong(), toString(), and toULongLong().
void* QLocale::v |
Definition at line 802 of file qlocale.h.
Referenced by operator=(), and QLocale().