Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QLocale class converts between numbers and their string representations in various languages. More...
Public Member Functions | |
override bool | Equals (object o) |
override int | GetHashCode () |
QLocale () | |
| |
QLocale (QLocale other) | |
| |
QLocale (string name) | |
| |
QLocale (QLocale.Language language, QLocale.Country country=QLocale.Country.AnyCountry) | |
| |
QLocale (QLocale.Language language, QLocale.Script script, QLocale.Country country) | |
| |
virtual void | CreateProxy () |
new string | AmText () |
| |
new string | Bcp47Name () |
| |
new QLocale.Country | country () |
| |
new string | CreateSeparatedList (System.Collections.Generic.List< string > strl) |
| |
new string | CurrencySymbol (QLocale.CurrencySymbolFormat arg1=QLocale.CurrencySymbolFormat.CurrencySymbol) |
| |
new string | DateFormat (QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | DateTimeFormat (QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | DayName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new QChar | DecimalPoint () |
| |
new QChar | Exponential () |
| |
new Qt.DayOfWeek | FirstDayOfWeek () |
| |
new QChar | GroupSeparator () |
| |
new QLocale.Language | language () |
| |
new QLocale.MeasurementSystem | measurementSystem () |
| |
new string | MonthName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | Name () |
| |
new string | NativeCountryName () |
| |
new string | NativeLanguageName () |
| |
new QChar | NegativeSign () |
| |
new QChar | Percent () |
| |
new string | PmText () |
| |
new QChar | PositiveSign () |
| |
new string | QuoteString (QStringRef str, QLocale.QuotationStyle style=QLocale.QuotationStyle.StandardQuotation) |
| |
new string | QuoteString (string str, QLocale.QuotationStyle style=QLocale.QuotationStyle.StandardQuotation) |
| |
new QLocale.Script | script () |
| |
new string | StandaloneDayName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | StandaloneMonthName (int arg1, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new Qt.LayoutDirection | TextDirection () |
| |
new string | TimeFormat (QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | ToCurrencyString (long arg1, string symbol="") |
| |
new string | ToCurrencyString (ulong arg1, string symbol="") |
| |
new string | ToCurrencyString (short arg1, string symbol="") |
| |
new string | ToCurrencyString (ushort arg1, string symbol="") |
| |
new string | ToCurrencyString (int arg1, string symbol="") |
| |
new string | ToCurrencyString (uint arg1, string symbol="") |
| |
new string | ToCurrencyString (double arg1, string symbol="") |
| |
new string | ToCurrencyString (float arg1, string symbol="") |
| |
new QDate | ToDate (string @string, QLocale.FormatType arg2=QLocale.FormatType.LongFormat) |
| |
new QDate | ToDate (string @string, string format) |
| |
new QDateTime | ToDateTime (string @string, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new QDateTime | ToDateTime (string @string, string format) |
| |
new double | ToDouble (string s) |
| |
new double | ToDouble (string s, ref bool ok) |
| |
new float | ToFloat (string s) |
| |
new float | ToFloat (string s, ref bool ok) |
| |
new int | ToInt (string s) |
| |
new int | ToInt (string s, ref bool ok, int @base=0) |
| |
new long | ToLongLong (string s) |
| |
new long | ToLongLong (string s, ref bool ok, int @base=0) |
| |
new string | ToLower (string str) |
| |
new short | ToShort (string s) |
| |
new short | ToShort (string s, ref bool ok, int @base=0) |
| |
new string | ToString (QDate date, string formatStr) |
| |
new string | ToString (QDate date, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | ToString (QTime time, string formatStr) |
| |
new string | ToString (QTime time, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | ToString (QDateTime dateTime, QLocale.FormatType format=QLocale.FormatType.LongFormat) |
| |
new string | ToString (QDateTime dateTime, string format) |
| |
new string | ToString (long i) |
| |
new string | ToString (ulong i) |
| |
new string | ToString (short i) |
| |
new string | ToString (ushort i) |
| |
new string | ToString (int i) |
| |
new string | ToString (uint i) |
| |
new string | ToString (double i) |
| |
new string | ToString (float i) |
| |
new string | ToString (double i, sbyte f, int prec=6) |
| |
new string | ToString (float i, sbyte f, int prec=6) |
| |
new QTime | ToTime (string @string, QLocale.FormatType arg2=QLocale.FormatType.LongFormat) |
| |
new QTime | ToTime (string @string, string format) |
| |
new uint | ToUInt (string s) |
| |
new uint | ToUInt (string s, ref bool ok, int @base=0) |
| |
new long | ToULongLong (string s) |
| |
new long | ToULongLong (string s, ref bool ok, int @base=0) |
| |
new ushort | ToUShort (string s) |
| |
new ushort | ToUShort (string s, ref bool ok, int @base=0) |
| |
new string | ToUpper (string str) |
| |
new System.Collections.Generic.List < string > | UiLanguages () |
| |
new System.Collections.Generic.List < Qt.DayOfWeek > | Weekdays () |
| |
new QChar | ZeroDigit () |
| |
new void | Dispose () |
Static Public Member Functions | |
static QLocale | C () |
| |
static System.Collections.Generic.List < QLocale.Country > | CountriesForLanguage (QLocale.Language lang) |
| |
static string | CountryToString (QLocale.Country country) |
| |
static string | LanguageToString (QLocale.Language language) |
| |
static System.Collections.Generic.List < QLocale > | MatchingLocales (QLocale.Language language, QLocale.Script script, QLocale.Country country) |
| |
static bool | operator!= (QLocale arg1, QLocale arg2) |
| |
static bool | operator== (QLocale arg1, QLocale arg2) |
| |
static string | ScriptToString (QLocale.Script script) |
| |
static void | SetDefault (QLocale locale) |
| |
static QLocale | System () |
| |
Protected Member Functions | |
QLocale (System.Type dummy) | |
Protected Attributes | |
SmokeInvocation | interceptor |
Properties | |
new QLocale.NumberOption | NumberOptions [get, set] |
| |
virtual System.IntPtr | SmokeObject [get, set] |
static new QMetaObject | StaticMetaObject [get] |
The QLocale class converts between numbers and their string representations in various languages.
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.
Example:
QLocale egyptian(QLocale::Arabic, QLocale::Egypt);
QString s1 = egyptian.toString(1.571429E+07, 'e');
QString s2 = egyptian.toString(10);
double d = egyptian.toDouble(s1);
int i = 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:
If a QLocale object is constructed with the default constructor, it will use the default locale's settings.
QString::toInt(), QString::toDouble(), etc., interpret the string according to the default locale. If this fails, it falls back on the "C" locale.
QString::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));
QLocale hebrew; // Constructs a default QLocale
QString s1 = hebrew.toString(15714.3, 'e');
bool ok;
double d;
QLocale::setDefault(QLocale::C);
d = QString("1234,56").toDouble(&ok); // ok == false
d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56
QLocale::setDefault(QLocale::German);
d = QString("1234,56").toDouble(&ok); // ok == true, d == 1234.56
d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
str = QString("%1 L2 L3")
.arg(12345).arg(12345).arg(12345, 0, 16);
// str == "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()).
Use 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.
QLocale korean("ko");
QLocale swiss("de_CH");
This constructor converts the locale name to a language/country pair; it does not use the system locale database.
Note: For the current keyboard input locale take a look at QApplication::keyboardInputLocale().
QLocale's data is based on Common Locale Data Repository v1.8.1.
The double-to-string and string-to-double conversion functions are covered by the following licenses:
Copyright (c) 1991 by AT&T.
Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
This product includes software developed by the University of California, Berkeley and its contributors.
See also QString::arg(), QString::toInt(), QString::toDouble(), and QApplication::keyboardInputLocale().
This enumerated type is used to specify a country.
See also country() and countryToString().
Specifies the format of the currency symbol.
This enum was introduced or modified in Qt 4.8.
This enum describes the types of format that can be used when converting QDate and QTime objects to strings.
This enumerated type is used to specify a language.
See also language() and languageToString().
This enum defines which units are used for measurement.
This enum was introduced or modified in Qt 4.4.
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().
See also setNumberOptions() and numberOptions().
This enum defines a set of possible styles for locale specific quotation.
This enum was introduced or modified in Qt 4.8.
See also quoteString().
This enumerated type is used to specify a script.
This enum was introduced or modified in Qt 4.8.
See also script(), scriptToString(), and languageToString().
|
protected |
QtCore.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().
See also setDefault().
QtCore.QLocale.QLocale | ( | string | name | ) |
Constructs a QLocale object with the specified name, which has the format "language[_script][_country][.codeset][]" or "C", where:
language is a lowercase, two-letter, ISO 639 language code,
script is a titlecase, four-letter, ISO 15924 script code,
country is an uppercase, two- or three-letter, ISO 3166 country code (also "419" as defined by United Nations),
and codeset and modifier are ignored.
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).
See also bcp47Name().
QtCore.QLocale.QLocale | ( | QLocale.Language | language, |
QLocale.Country | country = QLocale.Country.AnyCountry |
||
) |
Constructs a 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().
See also setDefault(), language(), and country().
QtCore.QLocale.QLocale | ( | QLocale.Language | language, |
QLocale.Script | script, | ||
QLocale.Country | country | ||
) |
Constructs a 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().
This function was introduced in Qt 4.8.
See also setDefault(), language(), script(), and country().
new string QtCore.QLocale.AmText | ( | ) |
Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hour clock.
This function was introduced in Qt 4.5.
See also pmText().
new string QtCore.QLocale.Bcp47Name | ( | ) |
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.
This function was introduced in Qt 4.8.
See also language(), country(), script(), and uiLanguages().
|
static |
Returns a QLocale object initialized to the "C" locale.
See also system().
|
static |
new QLocale.Country QtCore.QLocale.country | ( | ) |
Returns the country of this locale.
See also language(), script(), countryToString(), and bcp47Name().
|
static |
Returns a QString containing the name of country.
See also languageToString(), scriptToString(), country(), and bcp47Name().
|
virtual |
new string QtCore.QLocale.CreateSeparatedList | ( | System.Collections.Generic.List< string > | strl | ) |
Returns a string that represents a join of a given list of strings with a separator defined by the locale.
This function was introduced in Qt 4.8.
new string QtCore.QLocale.CurrencySymbol | ( | QLocale.CurrencySymbolFormat | arg1 = QLocale.CurrencySymbolFormat.CurrencySymbol | ) |
Returns a currency symbol according to the format.
This function was introduced in Qt 4.8.
new string QtCore.QLocale.DateFormat | ( | QLocale.FormatType | format = QLocale.FormatType.LongFormat | ) |
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.
This function was introduced in Qt 4.1.
See also QDate::toString() and QDate::fromString().
new string QtCore.QLocale.DateTimeFormat | ( | QLocale.FormatType | format = QLocale.FormatType.LongFormat | ) |
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.
This function was introduced in Qt 4.4.
See also QDateTime::toString() and QDateTime::fromString().
new string QtCore.QLocale.DayName | ( | int | arg1, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type.
This function was introduced in Qt 4.2.
See also monthName() and standaloneDayName().
new QChar QtCore.QLocale.DecimalPoint | ( | ) |
Returns the decimal point character of this locale.
This function was introduced in Qt 4.1.
new void QtCore.QLocale.Dispose | ( | ) |
override bool QtCore.QLocale.Equals | ( | object | o | ) |
new QChar QtCore.QLocale.Exponential | ( | ) |
Returns the exponential character of this locale.
This function was introduced in Qt 4.1.
new Qt.DayOfWeek QtCore.QLocale.FirstDayOfWeek | ( | ) |
Returns the first day of the week according to the current locale.
This function was introduced in Qt 4.8.
override int QtCore.QLocale.GetHashCode | ( | ) |
new QChar QtCore.QLocale.GroupSeparator | ( | ) |
Returns the group separator character of this locale.
This function was introduced in Qt 4.1.
new QLocale.Language QtCore.QLocale.language | ( | ) |
|
static |
Returns a QString containing the name of language.
See also countryToString(), scriptToString(), and bcp47Name().
|
static |
new QLocale.MeasurementSystem QtCore.QLocale.measurementSystem | ( | ) |
Returns the measurement system for the locale.
This function was introduced in Qt 4.4.
new string QtCore.QLocale.MonthName | ( | int | arg1, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
Returns the localized name of month, in the format specified by type.
This function was introduced in Qt 4.2.
See also dayName() and standaloneMonthName().
new string QtCore.QLocale.Name | ( | ) |
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.
See also QLocale(), language(), script(), country(), and bcp47Name().
new string QtCore.QLocale.NativeCountryName | ( | ) |
Returns a native name of the country for the locale. For example "España" for Spanish/Spain locale.
This function was introduced in Qt 4.8.
See also nativeLanguageName() and countryToString().
new string QtCore.QLocale.NativeLanguageName | ( | ) |
Returns a native name of the language for the locale. For example "Schwiizertüütsch" for Swiss-German locale.
This function was introduced in Qt 4.8.
See also nativeCountryName() and languageToString().
new QChar QtCore.QLocale.NegativeSign | ( | ) |
Returns the negative sign character of this locale.
This function was introduced in Qt 4.1.
Returns true if the QLocale object is not the same as the other locale specified; otherwise returns false.
Returns true if the QLocale object is the same as the other locale specified; otherwise returns false.
new QChar QtCore.QLocale.Percent | ( | ) |
Returns the percent character of this locale.
This function was introduced in Qt 4.1.
new string QtCore.QLocale.PmText | ( | ) |
Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hour clock.
This function was introduced in Qt 4.5.
See also amText().
new QChar QtCore.QLocale.PositiveSign | ( | ) |
Returns the positive sign character of this locale.
This function was introduced in Qt 4.5.
new string QtCore.QLocale.QuoteString | ( | QStringRef | str, |
QLocale.QuotationStyle | style = QLocale.QuotationStyle.StandardQuotation |
||
) |
This is an overloaded function.
This function was introduced in Qt 4.8.
new string QtCore.QLocale.QuoteString | ( | string | str, |
QLocale.QuotationStyle | style = QLocale.QuotationStyle.StandardQuotation |
||
) |
Returns str quoted according to the current locale using the given quotation style.
This function was introduced in Qt 4.8.
new QLocale.Script QtCore.QLocale.script | ( | ) |
Returns the script of this locale.
This function was introduced in Qt 4.8.
See also language(), country(), languageToString(), scriptToString(), and bcp47Name().
|
static |
|
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.
Warning: In a multithreaded application, the default locale should be set at application startup, before any non-GUI threads are created.
Warning: This function is not reentrant.
See also system() and c().
new string QtCore.QLocale.StandaloneDayName | ( | int | arg1, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
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().
This function was introduced in Qt 4.5.
See also dayName() and standaloneMonthName().
new string QtCore.QLocale.StandaloneMonthName | ( | int | arg1, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
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().
This function was introduced in Qt 4.5.
See also monthName() and standaloneDayName().
|
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.
See also c().
new Qt.LayoutDirection QtCore.QLocale.TextDirection | ( | ) |
Returns the text direction of the language.
This function was introduced in Qt 4.7.
new string QtCore.QLocale.TimeFormat | ( | QLocale.FormatType | format = QLocale.FormatType.LongFormat | ) |
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.
This function was introduced in Qt 4.1.
See also QTime::toString() and QTime::fromString().
new string QtCore.QLocale.ToCurrencyString | ( | long | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | ulong | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | short | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | ushort | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | int | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | uint | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | double | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new string QtCore.QLocale.ToCurrencyString | ( | float | arg1, |
string | symbol = "" |
||
) |
Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.
This function was introduced in Qt 4.8.
See also currencySymbol().
new QDate QtCore.QLocale.ToDate | ( | string @ | string, |
QLocale.FormatType | arg2 = QLocale.FormatType.LongFormat |
||
) |
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.
This function was introduced in Qt 4.4.
See also dateFormat(), toTime(), toDateTime(), and QDate::fromString().
new QDate QtCore.QLocale.ToDate | ( | string @ | string, |
string | format | ||
) |
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.
This function was introduced in Qt 4.4.
See also dateFormat(), toTime(), toDateTime(), and QDate::fromString().
new QDateTime QtCore.QLocale.ToDateTime | ( | string @ | string, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
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.
This function was introduced in Qt 4.4.
See also dateTimeFormat(), toTime(), toDate(), and QDateTime::fromString().
new QDateTime QtCore.QLocale.ToDateTime | ( | string @ | string, |
string | format | ||
) |
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.
Note: The month and day names used must be given in the user's local language.
If the string could not be parsed, returns an invalid QDateTime.
This function was introduced in Qt 4.4.
See also dateTimeFormat(), toTime(), toDate(), and QDateTime::fromString().
new double QtCore.QLocale.ToDouble | ( | string | s | ) |
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.
bool ok;
double d;
QLocale c(QLocale::C);
d = c.toDouble( "1234.56", &ok ); // ok == true, d == 1234.56
d = c.toDouble( "1,234.56", &ok ); // ok == true, d == 1234.56
d = c.toDouble( "1234,56", &ok ); // ok == false
QLocale german(QLocale::German);
d = german.toDouble( "1234,56", &ok ); // ok == true, d == 1234.56
d = german.toDouble( "1.234,56", &ok ); // ok == true, d == 1234.56
d = german.toDouble( "1234.56", &ok ); // ok == false
d = german.toDouble( "1.234", &ok ); // ok == true, d == 1234.0
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.
See also toFloat(), toInt(), and toString().
new double QtCore.QLocale.ToDouble | ( | string | s, |
ref bool | ok | ||
) |
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.
bool ok;
double d;
QLocale c(QLocale::C);
d = c.toDouble( "1234.56", &ok ); // ok == true, d == 1234.56
d = c.toDouble( "1,234.56", &ok ); // ok == true, d == 1234.56
d = c.toDouble( "1234,56", &ok ); // ok == false
QLocale german(QLocale::German);
d = german.toDouble( "1234,56", &ok ); // ok == true, d == 1234.56
d = german.toDouble( "1.234,56", &ok ); // ok == true, d == 1234.56
d = german.toDouble( "1234.56", &ok ); // ok == false
d = german.toDouble( "1.234", &ok ); // ok == true, d == 1234.0
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.
See also toFloat(), toInt(), and toString().
new float QtCore.QLocale.ToFloat | ( | string | s | ) |
Returns the float 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.
This function ignores leading and trailing whitespace.
See also toDouble(), toInt(), and toString().
new float QtCore.QLocale.ToFloat | ( | string | s, |
ref bool | ok | ||
) |
Returns the float 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.
This function ignores leading and trailing whitespace.
See also toDouble(), toInt(), and toString().
new int QtCore.QLocale.ToInt | ( | string | s | ) |
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.
See also toUInt() and toString().
new int QtCore.QLocale.ToInt | ( | string | s, |
ref bool | ok, | ||
int @ | base = 0 |
||
) |
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.
See also toUInt() and toString().
new long QtCore.QLocale.ToLongLong | ( | string | s | ) |
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.
See also toInt(), toULongLong(), toDouble(), and toString().
new long QtCore.QLocale.ToLongLong | ( | string | s, |
ref bool | ok, | ||
int @ | base = 0 |
||
) |
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.
See also toInt(), toULongLong(), toDouble(), and toString().
new string QtCore.QLocale.ToLower | ( | string | str | ) |
Returns a lowercase copy of str.
This function was introduced in Qt 4.8.
new short QtCore.QLocale.ToShort | ( | string | s | ) |
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.
See also toUShort() and toString().
new short QtCore.QLocale.ToShort | ( | string | s, |
ref bool | ok, | ||
int @ | base = 0 |
||
) |
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.
See also toUShort() and toString().
new string QtCore.QLocale.ToString | ( | QDate | date, |
string | formatStr | ||
) |
Returns a localized string representation of the given date in the specified format. If format is an empty string, an empty string is returned.
new string QtCore.QLocale.ToString | ( | QDate | date, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
Returns a localized string representation of the given date according to the specified format.
new string QtCore.QLocale.ToString | ( | QTime | time, |
string | formatStr | ||
) |
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.
new string QtCore.QLocale.ToString | ( | QTime | time, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
Returns a localized string representation of the given time in the specified format.
new string QtCore.QLocale.ToString | ( | QDateTime | dateTime, |
QLocale.FormatType | format = QLocale.FormatType.LongFormat |
||
) |
Returns a localized string representation of the given dateTime according to the specified format.
This function was introduced in Qt 4.4.
new string QtCore.QLocale.ToString | ( | QDateTime | dateTime, |
string | format | ||
) |
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.
This function was introduced in Qt 4.4.
new string QtCore.QLocale.ToString | ( | long | i | ) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | ulong | i | ) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | short | i | ) |
This is an overloaded function.
See also toShort().
new string QtCore.QLocale.ToString | ( | ushort | i | ) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | int | i | ) |
This is an overloaded function.
See also toInt().
new string QtCore.QLocale.ToString | ( | uint | i | ) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | double | i | ) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | float | i | ) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | double | i, |
sbyte | f, | ||
int | prec = 6 |
||
) |
Returns a localized string representation of i.
See also toLongLong().
new string QtCore.QLocale.ToString | ( | float | i, |
sbyte | f, | ||
int | prec = 6 |
||
) |
Returns a localized string representation of i.
See also toLongLong().
new QTime QtCore.QLocale.ToTime | ( | string @ | string, |
QLocale.FormatType | arg2 = QLocale.FormatType.LongFormat |
||
) |
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.
This function was introduced in Qt 4.4.
See also timeFormat(), toDate(), toDateTime(), and QTime::fromString().
new QTime QtCore.QLocale.ToTime | ( | string @ | string, |
string | format | ||
) |
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.
This function was introduced in Qt 4.4.
See also timeFormat(), toDate(), toDateTime(), and QTime::fromString().
new uint QtCore.QLocale.ToUInt | ( | string | s | ) |
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.
See also toInt() and toString().
new uint QtCore.QLocale.ToUInt | ( | string | s, |
ref bool | ok, | ||
int @ | base = 0 |
||
) |
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.
See also toInt() and toString().
new long QtCore.QLocale.ToULongLong | ( | string | s | ) |
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.
See also toLongLong(), toInt(), toDouble(), and toString().
new long QtCore.QLocale.ToULongLong | ( | string | s, |
ref bool | ok, | ||
int @ | base = 0 |
||
) |
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.
See also toLongLong(), toInt(), toDouble(), and toString().
new string QtCore.QLocale.ToUpper | ( | string | str | ) |
Returns an uppercase copy of str.
This function was introduced in Qt 4.8.
new ushort QtCore.QLocale.ToUShort | ( | string | s | ) |
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.
See also toShort() and toString().
new ushort QtCore.QLocale.ToUShort | ( | string | s, |
ref bool | ok, | ||
int @ | base = 0 |
||
) |
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.
See also toShort() and toString().
new System.Collections.Generic.List<string> QtCore.QLocale.UiLanguages | ( | ) |
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.
This function was introduced in Qt 4.8.
See also QTranslator and bcp47Name().
new System.Collections.Generic.List<Qt.DayOfWeek> QtCore.QLocale.Weekdays | ( | ) |
Returns a list of days that are considered weekdays according to the current locale.
This function was introduced in Qt 4.8.
new QChar QtCore.QLocale.ZeroDigit | ( | ) |
Returns the zero digit character of this locale.
This function was introduced in Qt 4.1.
|
protected |
|
getset |
|
getset |
|
staticget |