QtBase
v6.3.1
|
#include <qlocale.h>
Static Public Member Functions | |
static QString | languageToCode (Language language, LanguageCodeTypes codeTypes=AnyLanguageCode) |
static Language | codeToLanguage (QStringView languageCode, LanguageCodeTypes codeTypes=AnyLanguageCode) noexcept |
static QString | territoryToCode (Territory territory) |
static Territory | codeToTerritory (QStringView territoryCode) noexcept |
static QString | scriptToCode (Script script) |
static Script | codeToScript (QStringView scriptCode) noexcept |
static QString | languageToString (Language language) |
static QString | territoryToString (Territory territory) |
static QString | scriptToString (Script script) |
static void | setDefault (const QLocale &locale) |
static QLocale | c () |
static QLocale | system () |
static QList< QLocale > | matchingLocales (QLocale::Language language, QLocale::Script script, QLocale::Territory territory) |
Friends | |
class | QString |
class | QByteArray |
class | QIntValidator |
class | QDoubleValidatorPrivate |
class | QTextStream |
class | QTextStreamPrivate |
class | QLocalePrivate |
class | QSystemLocale |
class | QCalendarBackend |
class | QGregorianCalendar |
Q_CORE_EXPORT size_t | qHash (const QLocale &key, size_t seed) noexcept |
bool | operator== (const QLocale &lhs, const QLocale &rhs) |
bool | operator!= (const QLocale &lhs, const QLocale &rhs) |
Related Functions | |
(Note that these are not member functions.) | |
size_t | qHash (const QLocale &key, size_t seed) noexcept |
using QLocale::Territory = Country |
enum QLocale::Country : ushort |
Specifies the format for representation of data quantities.
\omitvalue DataSizeBase1000 \omitvalue DataSizeSIQuantifiers \value DataSizeIecFormat format using base 1024 and IEC prefixes: KiB, MiB, GiB, ... \value DataSizeTraditionalFormat format using base 1024 and SI prefixes: kB, MB, GB, ... \value DataSizeSIFormat format using base 1000 and SI prefixes: kB, MB, GB, ...
Enumerator | |
---|---|
DataSizeBase1000 | |
DataSizeSIQuantifiers | |
DataSizeIecFormat | |
DataSizeTraditionalFormat | |
DataSizeSIFormat |
enum QLocale::FormatType |
enum QLocale::Language : ushort |
enum QLocale::Script : ushort |
QLocale::QLocale | ( | ) |
Constructs a 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().
Definition at line 1039 of file qlocale.cpp.
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 1027 of file qlocale.cpp.
|
explicit |
Constructs a QLocale object with the specified name.
The name has the format "language[_script][_territory][.codeset][@modifier]" or "C", where:
\list
The separator can be either underscore {'_'} (U+005F, "low line") or a dash
{'-'} (U+002D, "hyphen-minus"). If QLocale has no data for the specified combination of language, script, and territory, then it uses the most suitable match it can find instead. If the string violates the locale format, or no suitable data can be found for the specified keys, the "C" locale is used instead.
This constructor is much slower than QLocale(Language, Script, Territory) or QLocale(Language, Territory).
Definition at line 1018 of file qlocale.cpp.
Constructs a QLocale object for the specified language and territory.
If there is more than one script in use for this combination, a likely script will be selected. If QLocale has no data for the specified language, the default locale is used. If QLocale has no data for the specified combination of language and territory, an alternative territory may be used instead.
Definition at line 1058 of file qlocale.cpp.
QLocale::QLocale | ( | Language | language, |
Script | script = AnyScript , |
||
Territory | territory = AnyTerritory |
||
) |
Constructs a QLocale object for the specified language, script and territory.
If QLocale does not have data for the given combination, it will find data for as good a match as it can. It falls back on the default locale if
\list
AnyLanguage
and no language can be inferred from script and territory Definition at line 1082 of file qlocale.cpp.
Constructs a QLocale object as a copy of other.
Definition at line 1091 of file qlocale.cpp.
QLocale::~QLocale | ( | ) |
Destructor
Definition at line 1100 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 3285 of file qlocale.cpp.
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 1405 of file qlocale.cpp.
|
inlinestatic |
Returns a 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).
Definition at line 1134 of file qlocale.h.
|
staticnoexcept |
Returns the QLocale::Language enum corresponding to the two- or three-letter languageCode, as defined in the ISO 639 standards.
If specified, codeTypes selects which set of codes to consider for conversion. By default all codes known to Qt are considered. The codes are matched in the following order: ISO639Part1
, ISO639Part2B
, ISO639Part2T
, ISO639Part3
, LegacyLanguageCode
.
If the code is invalid or not known QLocale::AnyLanguage
is returned.
Definition at line 1447 of file qlocale.cpp.
|
staticnoexcept |
Returns the QLocale::Script enum corresponding to the four-letter script scriptCode, as defined in the ISO 15924 standard.
If the code is invalid or not known QLocale::AnyScript is returned.
Definition at line 1538 of file qlocale.cpp.
|
staticnoexcept |
Returns the QLocale::Territory enum corresponding to the two-letter or three-digit territoryCode, as defined in the ISO 3166 standard.
If the code is invalid or not known QLocale::AnyTerritory is returned.
Definition at line 1478 of file qlocale.cpp.
QLocale QLocale::collation | ( | ) | const |
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.
Definition at line 4504 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 1222 of file qlocale.cpp.
QString QLocale::currencySymbol | ( | QLocale::CurrencySymbolFormat | format = CurrencySymbol | ) | const |
Definition at line 4236 of file qlocale.cpp.
QString QLocale::dateFormat | ( | FormatType | format = LongFormat | ) | const |
Returns the date format used for the current locale.
If format is LongFormat, the format will be elaborate, otherwise it will be short. For example, LongFormat for the {en_US} locale is
{dddd, MMMM d, yyyy}, ShortFormat is
{M/d/yy}.
Definition at line 2265 of file qlocale.cpp.
QString QLocale::dateTimeFormat | ( | FormatType | format = LongFormat | ) | const |
Returns the date time format used for the current locale.
If format is LongFormat, the format will be elaborate, otherwise it will be short. For example, LongFormat for the {en_US} locale is
{dddd, MMMM d, yyyy h:mm:ss AP t}, ShortFormat is
{M/d/yy h:mm AP}.
Definition at line 2327 of file qlocale.cpp.
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.
For example, if the locale is en_US
and day is 1, \l LongFormat will return Monday
, \l ShortFormat Mon
, and \l NarrowFormat M
.
Definition at line 2853 of file qlocale.cpp.
QString QLocale::decimalPoint | ( | ) | const |
Returns the decimal point character of this locale.
Definition at line 2549 of file qlocale.cpp.
QString QLocale::exponential | ( | ) | const |
Returns the exponential character of this locale, used to separate exponent from mantissa in some floating-point numeric representations.
Definition at line 2622 of file qlocale.cpp.
Qt::DayOfWeek QLocale::firstDayOfWeek | ( | ) | const |
Returns the first day of the week according to the current locale.
Definition at line 3118 of file qlocale.cpp.
QString QLocale::formattedDataSize | ( | qint64 | bytes, |
int | precision = 2 , |
||
DataSizeFormats | format = DataSizeIecFormat |
||
) | const |
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 \l DataSizeIecFormat (the default), this function returns "16.00 KiB"; for 1330409069609 bytes it returns "1.21 GiB"; and so on. If format is \l DataSizeIecFormat or \l DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for \l 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.
Definition at line 4383 of file qlocale.cpp.
QString QLocale::groupSeparator | ( | ) | const |
Returns the group separator character of this locale.
Definition at line 2561 of file qlocale.cpp.
QLocale::Language QLocale::language | ( | ) | const |
Returns the language of this locale.
Definition at line 1293 of file qlocale.cpp.
|
static |
Returns the two- or three-letter language code for language, as defined in the ISO 639 standards.
If specified, codeTypes selects which set of codes to consider. The first code from the set that is defined for language is returned. Otherwise, all ISO-639 codes are considered. The codes are considered in the following order: ISO639Part1
, ISO639Part2B
, ISO639Part2T
, ISO639Part3
. LegacyLanguageCode
is ignored by this function.
{QLocale::C} the function returns
{"C"}. For QLocale::AnyLanguage
an empty string is returned. If the language has no code in any selected code set, an empty string is returned.Definition at line 1428 of file qlocale.cpp.
Returns a QString containing the name of language.
Definition at line 1549 of file qlocale.cpp.
|
static |
Returns a list of valid locale objects that match the given language, script and territory.
Getting a list of all locales: QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyTerritory);
Getting a list of locales suitable for Russia: QList<QLocale> locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::Russia);
Definition at line 2757 of file qlocale.cpp.
QLocale::MeasurementSystem QLocale::measurementSystem | ( | ) | const |
Returns the measurement system for the locale.
Definition at line 3172 of file qlocale.cpp.
QString QLocale::monthName | ( | int | month, |
FormatType | type = LongFormat |
||
) | const |
Returns the localized name of month, in the format specified by type.
For example, if the locale is en_US
and month is 1, \l LongFormat will return January
. \l ShortFormat Jan
, and \l NarrowFormat J
.
Definition at line 2819 of file qlocale.cpp.
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 \l bcp47Name() instead if you need a full locale name.
Definition at line 1349 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 4524 of file qlocale.cpp.
QString QLocale::nativeTerritoryName | ( | ) | const |
Returns a native name of the territory for the locale. For example "España" for Spanish/Spain locale.
Definition at line 4544 of file qlocale.cpp.
QString QLocale::negativeSign | ( | ) | const |
Returns the negative sign character of this locale.
Definition at line 2597 of file qlocale.cpp.
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, except for the "C" locale, which has OmitGroupSeparator set by default.
Definition at line 1169 of file qlocale.cpp.
Assigns other to this QLocale object and returns a reference to this QLocale object.
Definition at line 1109 of file qlocale.cpp.
QString QLocale::percent | ( | ) | const |
Returns the percent character of this locale.
Definition at line 2573 of file qlocale.cpp.
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 3305 of file qlocale.cpp.
QString QLocale::positiveSign | ( | ) | const |
Returns the positive sign character of this locale.
Definition at line 2609 of file qlocale.cpp.
|
inline |
QString QLocale::quoteString | ( | QStringView | 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 1188 of file qlocale.cpp.
QLocale::Script QLocale::script | ( | ) | const |
Returns the script of this locale.
Definition at line 1305 of file qlocale.cpp.
Returns the four-letter script code for script, as defined in the ISO 15924 standard.
{QLocale::AnyScript} an empty string is returned.Definition at line 1524 of file qlocale.cpp.
|
static |
Returns a QString containing the name of script.
Definition at line 1591 of file qlocale.cpp.
\nonreentrant
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 1271 of file qlocale.cpp.
void QLocale::setNumberOptions | ( | NumberOptions | options | ) |
Sets the options related to number conversions for this QLocale instance.
Definition at line 1153 of file qlocale.cpp.
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 2870 of file qlocale.cpp.
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 2835 of file qlocale.cpp.
|
static |
Returns a QLocale object initialized to the system locale.
The system locale may use system-specific sources for locale data, where available, otherwise falling back on QLocale's built-in database entry for the language, script and territory the system reports.
For example, 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 2737 of file qlocale.cpp.
QLocale::Territory QLocale::territory | ( | ) | const |
Returns the territory of this locale.
Definition at line 1317 of file qlocale.cpp.
|
static |
Returns the two-letter territory code for territory, as defined in the ISO 3166 standard.
{QLocale::AnyTerritory} an empty string is returned.Definition at line 1463 of file qlocale.cpp.
|
static |
Returns a QString containing the name of territory.
Definition at line 1563 of file qlocale.cpp.
Qt::LayoutDirection QLocale::textDirection | ( | ) | const |
Returns the text direction of the language.
Definition at line 3190 of file qlocale.cpp.
QString QLocale::timeFormat | ( | FormatType | format = LongFormat | ) | const |
Returns the time format used for the current locale.
If format is LongFormat, the format will be elaborate, otherwise it will be short. For example, LongFormat for the {en_US} locale is
{h:mm:ss AP t}, ShortFormat is
{h:mm AP}.
Definition at line 2296 of file qlocale.cpp.
QString QLocale::toCurrencyString | ( | double | value, |
const QString & | symbol = QString() , |
||
int | precision = -1 |
||
) | const |
Definition at line 4323 of file qlocale.cpp.
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 4268 of file qlocale.cpp.
QString QLocale::toCurrencyString | ( | qulonglong | value, |
const QString & | symbol = QString() |
||
) | const |
Definition at line 4295 of file qlocale.cpp.
Returns the double represented by the localized string s.
Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).
If ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
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 979 of file qlocale.h.
double QLocale::toDouble | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the double represented by the localized string s.
Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).
If ok is not \nullptr, failure is reported 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 1970 of file qlocale.cpp.
Returns the float represented by the localized string s.
Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).
If ok is not \nullptr, failure is reported by setting *{ok} to false
, and success by setting *{ok} to true
.
This function does not fall back to the 'C' locale if the string cannot be interpreted in this locale.
This function ignores leading and trailing whitespace.
Definition at line 977 of file qlocale.h.
float QLocale::toFloat | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the float represented by the localized string s.
Returns an infinity if the conversion overflows or 0.0 if the conversion fails for any other reason (e.g. underflow).
If ok is not \nullptr, 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 1940 of file qlocale.cpp.
Returns the int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 965 of file qlocale.h.
int QLocale::toInt | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the int represented by the localized string s.
If the conversion fails, the function returns 0.
If ok is not \nullptr, 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 1818 of file qlocale.cpp.
Returns the long int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 969 of file qlocale.h.
long QLocale::toLong | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 1857 of file qlocale.cpp.
Returns the long long int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 973 of file qlocale.h.
qlonglong QLocale::toLongLong | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the long long int represented by the localized string s.
If the conversion fails, the function returns 0.
If ok is not \nullptr, 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 1898 of file qlocale.cpp.
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 QString::toLower() as a generic fallback.
Definition at line 3264 of file qlocale.cpp.
Returns the short int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 961 of file qlocale.h.
short QLocale::toShort | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the short int represented by the localized string s.
If the conversion fails, the function returns 0.
If ok is not \nullptr, 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 1778 of file qlocale.cpp.
QString QLocale::toString | ( | const QDateTime & | dateTime, |
FormatType | format, | ||
QCalendar | cal | ||
) | const |
Returns a localized string representation of the given dateTime according to the specified format (see dateTimeFormat()), optionally for a specified calendar cal.
Definition at line 2183 of file qlocale.cpp.
QString QLocale::toString | ( | const QDateTime & | dateTime, |
FormatType | format = LongFormat |
||
) | const |
Definition at line 2207 of file qlocale.cpp.
QString QLocale::toString | ( | const QDateTime & | dateTime, |
QStringView | format | ||
) | const |
Definition at line 2168 of file qlocale.cpp.
QString QLocale::toString | ( | const QDateTime & | dateTime, |
QStringView | format, | ||
QCalendar | cal | ||
) | const |
Returns a localized string representation of the given dateTime according to the specified format, optionally for a specified calendar cal. If format is an empty string, an empty string is returned.
Definition at line 2159 of file qlocale.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a string representing the floating-point number f.
The form of the representation is controlled by the format and precision parameters.
The format defaults to {'g'}. It can be any of the following:
\table \header
'e'
'E'
'f'
'g'
'e'
or 'f'
format, whichever is more concise \row 'G'
'E'
or 'f'
format, whichever is more concise \endtableFor the 'e'
, 'E'
, and 'f'
formats, the precision represents the number of digits after the decimal point. For the 'g'
and 'G'
formats, the precision represents the maximum number of significant digits (trailing zeroes are omitted). The special precision value QLocale::FloatingPointShortest selects the shortest representation that, when read as a number, gets back the original floating-point value. Aside from that, any negative precision is ignored in favor of the default, 6.
For the 'e'
, 'f'
and 'g'
formats, positive infinity is represented as "inf", negative infinity as "-inf" and floating-point NaN (not-a-number) values are represented as "nan". For the 'E'
and 'G'
formats, "INF" and "NAN" are used instead. This does not vary with locale.
Definition at line 2676 of file qlocale.cpp.
|
inline |
|
inline |
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 2012 of file qlocale.cpp.
QString QLocale::toString | ( | QDate | date, |
FormatType | format, | ||
QCalendar | cal | ||
) | const |
Returns a localized string representation of the given date according to the specified format (see dateFormat()), optionally for a specified calendar cal.
Definition at line 2075 of file qlocale.cpp.
QString QLocale::toString | ( | QDate | date, |
FormatType | format = LongFormat |
||
) | const |
Definition at line 2099 of file qlocale.cpp.
QString QLocale::toString | ( | QDate | date, |
QStringView | format | ||
) | const |
Definition at line 2060 of file qlocale.cpp.
QString QLocale::toString | ( | QDate | date, |
QStringView | format, | ||
QCalendar | cal | ||
) | const |
Returns a localized string representation of the given date in the specified format, optionally for a specified calendar cal. If format is an empty string, an empty string is returned.
Definition at line 2051 of file qlocale.cpp.
Returns a localized string representation of i.
Definition at line 1981 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 2025 of file qlocale.cpp.
QString QLocale::toString | ( | QTime | time, |
FormatType | format = LongFormat |
||
) | const |
Returns a localized string representation of the given time in the specified format (see timeFormat()).
Definition at line 2233 of file qlocale.cpp.
QString QLocale::toString | ( | QTime | time, |
QStringView | format | ||
) | const |
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 2145 of file qlocale.cpp.
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 1995 of file qlocale.cpp.
|
inline |
Returns the unsigned int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 967 of file qlocale.h.
uint QLocale::toUInt | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the unsigned int represented by the localized string s.
If the conversion fails, the function returns 0.
If ok is not \nullptr, 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 1838 of file qlocale.cpp.
Returns the unsigned long int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 971 of file qlocale.h.
ulong QLocale::toULong | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 1877 of file qlocale.cpp.
|
inline |
Returns the unsigned long long int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 975 of file qlocale.h.
qulonglong QLocale::toULongLong | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the unsigned long long int represented by the localized string s.
If the conversion fails, the function returns 0.
If ok is not \nullptr, 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 1919 of file qlocale.cpp.
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 QString::toUpper() as a generic fallback.
Definition at line 3240 of file qlocale.cpp.
Returns the unsigned short int represented by the localized string s.
If the conversion fails the function returns 0.
If ok is not \nullptr, 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 963 of file qlocale.h.
ushort QLocale::toUShort | ( | QStringView | s, |
bool * | ok = nullptr |
||
) | const |
Returns the unsigned short int represented by the localized string s.
If the conversion fails, the function returns 0.
If ok is not \nullptr, 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 1798 of file qlocale.cpp.
QStringList QLocale::uiLanguages | ( | ) | const |
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 QTranslator::load() function.
The first item in the list is the most preferred one.
Definition at line 4430 of file qlocale.cpp.
QList< Qt::DayOfWeek > QLocale::weekdays | ( | ) | const |
Returns a list of days that are considered weekdays according to the current locale.
Definition at line 3146 of file qlocale.cpp.
QString QLocale::zeroDigit | ( | ) | const |
Returns the zero digit character of this locale.
Definition at line 2585 of file qlocale.cpp.
|
friend |
|
friend |
|
friend |
|
friend |
Returns the hash value for key, using seed to seed the calculation.
Definition at line 1140 of file qlocale.cpp.
Returns the hash value for key, using seed to seed the calculation.
Definition at line 1140 of file qlocale.cpp.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |