Struct qt_core::QLocale

source ·
#[repr(C)]
pub struct QLocale { /* private fields */ }
Expand description

The QLocale class converts between numbers and their string representations in various languages.

C++ class: QLocale.

C++ documentation:

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

QLocale's data is based on Common Locale Data Repository v31.0.1.

Implementations§

source§

impl QLocale

source

pub unsafe fn am_text(&self) -> CppBox<QString>

Returns the localized name of the "AM" suffix for times specified using the conventions of the 12-hour clock.

Calls C++ function: QString QLocale::amText() const.

C++ documentation:

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

source

pub unsafe fn bcp47_name(&self) -> CppBox<QString>

Returns the dash-separated language, script and country (and possibly other BCP47 fields) of this locale as a string.

Calls C++ function: QString QLocale::bcp47Name() const.

C++ documentation:

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

source

pub unsafe fn c() -> CppBox<QLocale>

Returns a QLocale object initialized to the "C" locale.

Calls C++ function: static QLocale QLocale::c().

C++ documentation:

Returns a QLocale object initialized to the “C” locale.

See also system().

source

pub unsafe fn collation(&self) -> CppBox<QLocale>

Available on cpp_lib_version="5.14.0" only.

Returns the locale to use for collation.

Calls C++ function: QLocale QLocale::collation() const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also QCollator.

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QLocale>> ) -> Ref<QLocale>

Assigns other to this QLocale object and returns a reference to this QLocale object.

Calls C++ function: QLocale& QLocale::operator=(const QLocale& other).

C++ documentation:

Assigns other to this QLocale object and returns a reference to this QLocale object.

source

pub unsafe fn countries_for_language(lang: Language) -> CppBox<QListOfCountry>

Returns the list of countries that have entries for language in Qt's locale database. If the result is an empty list, then language is not represented in Qt's locale database.

Calls C++ function: static QList<QLocale::Country> QLocale::countriesForLanguage(QLocale::Language lang).

C++ documentation:

Returns the list of countries that have entries for language in Qt’s locale database. If the result is an empty list, then language is not represented in Qt’s locale database.

This function was introduced in Qt 4.3.

See also matchingLocales().

source

pub unsafe fn country(&self) -> Country

Returns the country of this locale.

Calls C++ function: QLocale::Country QLocale::country() const.

C++ documentation:

Returns the country of this locale.

See also language(), script(), countryToString(), and bcp47Name().

source

pub unsafe fn country_to_string(country: Country) -> CppBox<QString>

Returns a QString containing the name of country.

Calls C++ function: static QString QLocale::countryToString(QLocale::Country country).

C++ documentation:

Returns a QString containing the name of country.

See also languageToString(), scriptToString(), country(), and bcp47Name().

source

pub unsafe fn create_separated_list( &self, strl: impl CastInto<Ref<QStringList>> ) -> CppBox<QString>

Returns a string that represents a join of a given list of strings with a separator defined by the locale.

Calls C++ function: QString QLocale::createSeparatedList(const QStringList& strl) const.

C++ documentation:

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.

source

pub unsafe fn currency_symbol_1a( &self, arg1: CurrencySymbolFormat ) -> CppBox<QString>

Returns a currency symbol according to the format.

Calls C++ function: QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat arg1 = …) const.

C++ documentation:

Returns a currency symbol according to the format.

This function was introduced in Qt 4.8.

source

pub unsafe fn currency_symbol_0a(&self) -> CppBox<QString>

Returns a currency symbol according to the format.

Calls C++ function: QString QLocale::currencySymbol() const.

C++ documentation:

Returns a currency symbol according to the format.

This function was introduced in Qt 4.8.

source

pub unsafe fn date_format_1a(&self, format: FormatType) -> CppBox<QString>

Returns the date format used for the current locale.

Calls C++ function: QString QLocale::dateFormat(QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn date_format_0a(&self) -> CppBox<QString>

Returns the date format used for the current locale.

Calls C++ function: QString QLocale::dateFormat() const.

C++ documentation:

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

source

pub unsafe fn date_time_format_1a(&self, format: FormatType) -> CppBox<QString>

Returns the date time format used for the current locale.

Calls C++ function: QString QLocale::dateTimeFormat(QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn date_time_format_0a(&self) -> CppBox<QString>

Returns the date time format used for the current locale.

Calls C++ function: QString QLocale::dateTimeFormat() const.

C++ documentation:

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

source

pub unsafe fn day_name_2a( &self, arg1: c_int, format: FormatType ) -> CppBox<QString>

Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type.

Calls C++ function: QString QLocale::dayName(int arg1, QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn day_name_1a(&self, arg1: c_int) -> CppBox<QString>

Returns the localized name of the day (where 1 represents Monday, 2 represents Tuesday and so on), in the format specified by type.

Calls C++ function: QString QLocale::dayName(int arg1) const.

C++ documentation:

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

source

pub unsafe fn decimal_point(&self) -> CppBox<QChar>

Returns the decimal point character of this locale.

Calls C++ function: QChar QLocale::decimalPoint() const.

C++ documentation:

Returns the decimal point character of this locale.

This function was introduced in Qt 4.1.

source

pub unsafe fn exponential(&self) -> CppBox<QChar>

Returns the exponential character of this locale.

Calls C++ function: QChar QLocale::exponential() const.

C++ documentation:

Returns the exponential character of this locale.

This function was introduced in Qt 4.1.

source

pub unsafe fn first_day_of_week(&self) -> DayOfWeek

Returns the first day of the week according to the current locale.

Calls C++ function: Qt::DayOfWeek QLocale::firstDayOfWeek() const.

C++ documentation:

Returns the first day of the week according to the current locale.

This function was introduced in Qt 4.8.

source

pub unsafe fn formatted_data_size_3a_mut( &self, bytes: i64, precision: c_int, format: QFlags<DataSizeFormat> ) -> CppBox<QString>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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 DataSizeIecFormat (the default), this function returns "16.00 KiB"; for 1330409069609 bytes it returns "1.21 GiB"; and so on. If format is DataSizeIecFormat or DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for 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.

Calls C++ function: QString QLocale::formattedDataSize(qint64 bytes, int precision = …, QFlags<QLocale::DataSizeFormat> format = …).

C++ documentation:

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 DataSizeIecFormat (the default), this function returns “16.00 KiB”; for 1330409069609 bytes it returns “1.21 GiB”; and so on. If format is DataSizeIecFormat or DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for 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.

This function was introduced in Qt 5.10.

source

pub unsafe fn formatted_data_size_2a_mut( &self, bytes: i64, precision: c_int ) -> CppBox<QString>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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 DataSizeIecFormat (the default), this function returns "16.00 KiB"; for 1330409069609 bytes it returns "1.21 GiB"; and so on. If format is DataSizeIecFormat or DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for 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.

Calls C++ function: QString QLocale::formattedDataSize(qint64 bytes, int precision = …).

C++ documentation:

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 DataSizeIecFormat (the default), this function returns “16.00 KiB”; for 1330409069609 bytes it returns “1.21 GiB”; and so on. If format is DataSizeIecFormat or DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for 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.

This function was introduced in Qt 5.10.

source

pub unsafe fn formatted_data_size_1a_mut(&self, bytes: i64) -> CppBox<QString>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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 DataSizeIecFormat (the default), this function returns "16.00 KiB"; for 1330409069609 bytes it returns "1.21 GiB"; and so on. If format is DataSizeIecFormat or DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for 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.

Calls C++ function: QString QLocale::formattedDataSize(qint64 bytes).

C++ documentation:

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 DataSizeIecFormat (the default), this function returns “16.00 KiB”; for 1330409069609 bytes it returns “1.21 GiB”; and so on. If format is DataSizeIecFormat or DataSizeTraditionalFormat, the given number of bytes is divided by a power of 1024, with result less than 1024; for 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.

This function was introduced in Qt 5.10.

source

pub unsafe fn formatted_data_size_3a( &self, bytes: i64, precision: c_int, format: QFlags<DataSizeFormat> ) -> CppBox<QString>

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Calls C++ function: QString QLocale::formattedDataSize(qint64 bytes, int precision = …, QFlags<QLocale::DataSizeFormat> format = …) const.

C++ documentation:

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use the const version instead.

source

pub unsafe fn formatted_data_size_2a( &self, bytes: i64, precision: c_int ) -> CppBox<QString>

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Calls C++ function: QString QLocale::formattedDataSize(qint64 bytes, int precision = …) const.

C++ documentation:

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use the const version instead.

source

pub unsafe fn formatted_data_size_1a(&self, bytes: i64) -> CppBox<QString>

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Calls C++ function: QString QLocale::formattedDataSize(qint64 bytes) const.

C++ documentation:

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use the const version instead.

source

pub unsafe fn group_separator(&self) -> CppBox<QChar>

Returns the group separator character of this locale.

Calls C++ function: QChar QLocale::groupSeparator() const.

C++ documentation:

Returns the group separator character of this locale.

This function was introduced in Qt 4.1.

source

pub unsafe fn language(&self) -> Language

Returns the language of this locale.

Calls C++ function: QLocale::Language QLocale::language() const.

C++ documentation:

Returns the language of this locale.

See also script(), country(), languageToString(), and bcp47Name().

source

pub unsafe fn language_to_string(language: Language) -> CppBox<QString>

Returns a QString containing the name of language.

Calls C++ function: static QString QLocale::languageToString(QLocale::Language language).

C++ documentation:

Returns a QString containing the name of language.

See also countryToString(), scriptToString(), and bcp47Name().

source

pub unsafe fn matching_locales( language: Language, script: Script, country: Country ) -> CppBox<QListOfQLocale>

Returns a list of valid locale objects that match the given language, script and country.

Calls C++ function: static QList<QLocale> QLocale::matchingLocales(QLocale::Language language, QLocale::Script script, QLocale::Country country).

C++ documentation:

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);

Getting a list of locales suitable for Russia: QList<QLocale> locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::Russia);

This function was introduced in Qt 4.8.

source

pub unsafe fn measurement_system(&self) -> MeasurementSystem

Returns the measurement system for the locale.

Calls C++ function: QLocale::MeasurementSystem QLocale::measurementSystem() const.

C++ documentation:

Returns the measurement system for the locale.

This function was introduced in Qt 4.4.

source

pub unsafe fn month_name_2a( &self, arg1: c_int, format: FormatType ) -> CppBox<QString>

Returns the localized name of month, in the format specified by type.

Calls C++ function: QString QLocale::monthName(int arg1, QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn month_name_1a(&self, arg1: c_int) -> CppBox<QString>

Returns the localized name of month, in the format specified by type.

Calls C++ function: QString QLocale::monthName(int arg1) const.

C++ documentation:

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

source

pub unsafe fn name(&self) -> CppBox<QString>

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.

Calls C++ function: QString QLocale::name() const.

C++ documentation:

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

source

pub unsafe fn native_country_name(&self) -> CppBox<QString>

Returns a native name of the country for the locale. For example "España" for Spanish/Spain locale.

Calls C++ function: QString QLocale::nativeCountryName() const.

C++ documentation:

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

source

pub unsafe fn native_language_name(&self) -> CppBox<QString>

Returns a native name of the language for the locale. For example "Schwiizertüütsch" for Swiss-German locale.

Calls C++ function: QString QLocale::nativeLanguageName() const.

C++ documentation:

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

source

pub unsafe fn negative_sign(&self) -> CppBox<QChar>

Returns the negative sign character of this locale.

Calls C++ function: QChar QLocale::negativeSign() const.

C++ documentation:

Returns the negative sign character of this locale.

This function was introduced in Qt 4.1.

source

pub unsafe fn new() -> CppBox<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().

Calls C++ function: [constructor] void QLocale::QLocale().

C++ documentation:

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

See also setDefault().

source

pub unsafe fn from_q_string( name: impl CastInto<Ref<QString>> ) -> CppBox<QLocale>

Constructs a QLocale object with the specified name, which has the format "language[_script][_country][.codeset][@modifier]" or "C", where:

Calls C++ function: [constructor] void QLocale::QLocale(const QString& name).

C++ documentation:

Constructs a QLocale object with the specified name, which has the format “language[_script][_country][.codeset][@modifier]” or “C”, where:

  • language is a lowercase, two-letter, ISO 639 language code (also some three-letter codes),
  • script is a titlecase, four-letter, ISO 15924 script code,
  • country is an uppercase, two-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 639 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().

source

pub unsafe fn from_language_country( language: Language, country: Country ) -> CppBox<QLocale>

Constructs a QLocale object with the specified language and country.

Calls C++ function: [constructor] void QLocale::QLocale(QLocale::Language language, QLocale::Country country = …).

C++ documentation:

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

source

pub unsafe fn from_language_script_country( language: Language, script: Script, country: Country ) -> CppBox<QLocale>

Constructs a QLocale object with the specified language, script and country.

Calls C++ function: [constructor] void QLocale::QLocale(QLocale::Language language, QLocale::Script script, QLocale::Country country).

C++ documentation:

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

source

pub unsafe fn from_language(language: Language) -> CppBox<QLocale>

Constructs a QLocale object with the specified language and country.

Calls C++ function: [constructor] void QLocale::QLocale(QLocale::Language language).

C++ documentation:

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

source

pub unsafe fn new_copy(other: impl CastInto<Ref<QLocale>>) -> CppBox<QLocale>

Constructs a QLocale object as a copy of other.

Calls C++ function: [constructor] void QLocale::QLocale(const QLocale& other).

C++ documentation:

Constructs a QLocale object as a copy of other.

source

pub unsafe fn number_options(&self) -> QFlags<NumberOption>

Returns the options related to number conversions for this QLocale instance.

Calls C++ function: QFlags<QLocale::NumberOption> QLocale::numberOptions() const.

C++ documentation:

Returns the options related to number conversions for this QLocale instance.

By default, no options are set for the standard locales.

This function was introduced in Qt 4.2.

See also setNumberOptions().

source

pub unsafe fn percent(&self) -> CppBox<QChar>

Returns the percent character of this locale.

Calls C++ function: QChar QLocale::percent() const.

C++ documentation:

Returns the percent character of this locale.

This function was introduced in Qt 4.1.

source

pub unsafe fn pm_text(&self) -> CppBox<QString>

Returns the localized name of the "PM" suffix for times specified using the conventions of the 12-hour clock.

Calls C++ function: QString QLocale::pmText() const.

C++ documentation:

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

source

pub unsafe fn positive_sign(&self) -> CppBox<QChar>

Returns the positive sign character of this locale.

Calls C++ function: QChar QLocale::positiveSign() const.

C++ documentation:

Returns the positive sign character of this locale.

This function was introduced in Qt 4.5.

source

pub unsafe fn quote_string_q_string_quotation_style( &self, str: impl CastInto<Ref<QString>>, style: QuotationStyle ) -> CppBox<QString>

Returns str quoted according to the current locale using the given quotation style.

Calls C++ function: QString QLocale::quoteString(const QString& str, QLocale::QuotationStyle style = …) const.

C++ documentation:

Returns str quoted according to the current locale using the given quotation style.

This function was introduced in Qt 4.8.

source

pub unsafe fn quote_string_q_string_ref_quotation_style( &self, str: impl CastInto<Ref<QStringRef>>, style: QuotationStyle ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::quoteString(const QStringRef& str, QLocale::QuotationStyle style = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn quote_string_q_string( &self, str: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Returns str quoted according to the current locale using the given quotation style.

Calls C++ function: QString QLocale::quoteString(const QString& str) const.

C++ documentation:

Returns str quoted according to the current locale using the given quotation style.

This function was introduced in Qt 4.8.

source

pub unsafe fn quote_string_q_string_ref( &self, str: impl CastInto<Ref<QStringRef>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::quoteString(const QStringRef& str) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn script(&self) -> Script

Returns the script of this locale.

Calls C++ function: QLocale::Script QLocale::script() const.

C++ documentation:

Returns the script of this locale.

This function was introduced in Qt 4.8.

See also language(), country(), languageToString(), scriptToString(), and bcp47Name().

source

pub unsafe fn script_to_string(script: Script) -> CppBox<QString>

Returns a QString containing the name of script.

Calls C++ function: static QString QLocale::scriptToString(QLocale::Script script).

C++ documentation:

Returns a QString containing the name of script.

This function was introduced in Qt 4.8.

See also languageToString(), countryToString(), script(), and bcp47Name().

source

pub unsafe fn set_default(locale: impl CastInto<Ref<QLocale>>)

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.

Calls C++ function: static void QLocale::setDefault(const QLocale& locale).

C++ documentation:

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

source

pub unsafe fn set_number_options(&self, options: QFlags<NumberOption>)

Sets the options related to number conversions for this QLocale instance.

Calls C++ function: void QLocale::setNumberOptions(QFlags<QLocale::NumberOption> options).

C++ documentation:

Sets the options related to number conversions for this QLocale instance.

This function was introduced in Qt 4.2.

See also numberOptions().

source

pub unsafe fn standalone_day_name_2a( &self, arg1: c_int, format: FormatType ) -> CppBox<QString>

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.

Calls C++ function: QString QLocale::standaloneDayName(int arg1, QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn standalone_day_name_1a(&self, arg1: c_int) -> CppBox<QString>

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.

Calls C++ function: QString QLocale::standaloneDayName(int arg1) const.

C++ documentation:

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

source

pub unsafe fn standalone_month_name_2a( &self, arg1: c_int, format: FormatType ) -> CppBox<QString>

Returns the localized name of month that is used as a standalone text, in the format specified by type.

Calls C++ function: QString QLocale::standaloneMonthName(int arg1, QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn standalone_month_name_1a(&self, arg1: c_int) -> CppBox<QString>

Returns the localized name of month that is used as a standalone text, in the format specified by type.

Calls C++ function: QString QLocale::standaloneMonthName(int arg1) const.

C++ documentation:

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

source

pub unsafe fn static_meta_object() -> Ref<QMetaObject>

Returns a reference to the staticMetaObject field.

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QLocale>>)

Swaps locale other with this locale. This operation is very fast and never fails.

Calls C++ function: void QLocale::swap(QLocale& other).

C++ documentation:

Swaps locale other with this locale. This operation is very fast and never fails.

This function was introduced in Qt 5.6.

source

pub unsafe fn system() -> CppBox<QLocale>

Returns a QLocale object initialized to the system locale.

Calls C++ function: static QLocale QLocale::system().

C++ documentation:

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

source

pub unsafe fn text_direction(&self) -> LayoutDirection

Returns the text direction of the language.

Calls C++ function: Qt::LayoutDirection QLocale::textDirection() const.

C++ documentation:

Returns the text direction of the language.

This function was introduced in Qt 4.7.

source

pub unsafe fn time_format_1a(&self, format: FormatType) -> CppBox<QString>

Returns the time format used for the current locale.

Calls C++ function: QString QLocale::timeFormat(QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn time_format_0a(&self) -> CppBox<QString>

Returns the time format used for the current locale.

Calls C++ function: QString QLocale::timeFormat() const.

C++ documentation:

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

source

pub unsafe fn to_currency_string_i64_q_string( &self, arg1: i64, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

Calls C++ function: QString QLocale::toCurrencyString(qlonglong arg1, const QString& symbol = …) const.

C++ documentation:

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

source

pub unsafe fn to_currency_string_u64_q_string( &self, arg1: u64, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(qulonglong arg1, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_short_q_string( &self, arg1: c_short, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(short arg1, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_ushort_q_string( &self, arg1: c_ushort, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(unsigned short arg1, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_int_q_string( &self, arg1: c_int, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(int arg1, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_uint_q_string( &self, arg1: c_uint, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(unsigned int arg1, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_double_q_string( &self, arg1: c_double, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(double arg1, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_double_q_string_int( &self, arg1: c_double, symbol: impl CastInto<Ref<QString>>, precision: c_int ) -> CppBox<QString>

This function overloads toCurrencyString().

Calls C++ function: QString QLocale::toCurrencyString(double arg1, const QString& symbol, int precision) const.

C++ documentation:

This function overloads toCurrencyString().

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol. If the precision is provided it is used to set the precision of the currency value.

This function was introduced in Qt 5.7.

See also currencySymbol().

source

pub unsafe fn to_currency_string_float_q_string( &self, i: c_float, symbol: impl CastInto<Ref<QString>> ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(float i, const QString& symbol = …) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_float_q_string_int( &self, i: c_float, symbol: impl CastInto<Ref<QString>>, precision: c_int ) -> CppBox<QString>

Calls C++ function: QString QLocale::toCurrencyString(float i, const QString& symbol, int precision) const.

source

pub unsafe fn to_currency_string_i64(&self, arg1: i64) -> CppBox<QString>

Returns a localized string representation of value as a currency. If the symbol is provided it is used instead of the default currency symbol.

Calls C++ function: QString QLocale::toCurrencyString(qlonglong arg1) const.

C++ documentation:

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

source

pub unsafe fn to_currency_string_u64(&self, arg1: u64) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(qulonglong arg1) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_short(&self, arg1: c_short) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(short arg1) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_ushort( &self, arg1: c_ushort ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(unsigned short arg1) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_int(&self, arg1: c_int) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(int arg1) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_uint(&self, arg1: c_uint) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(unsigned int arg1) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_double( &self, arg1: c_double ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(double arg1) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_currency_string_float(&self, i: c_float) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toCurrencyString(float i) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.8.

source

pub unsafe fn to_date_q_string_format_type( &self, string: impl CastInto<Ref<QString>>, arg2: FormatType ) -> CppBox<QDate>

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

Calls C++ function: QDate QLocale::toDate(const QString& string, QLocale::FormatType arg2 = …) const.

C++ documentation:

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

source

pub unsafe fn to_date_2_q_string( &self, string: impl CastInto<Ref<QString>>, format: impl CastInto<Ref<QString>> ) -> CppBox<QDate>

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.

Calls C++ function: QDate QLocale::toDate(const QString& string, const QString& format) const.

C++ documentation:

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

source

pub unsafe fn to_date_q_string( &self, string: impl CastInto<Ref<QString>> ) -> CppBox<QDate>

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

Calls C++ function: QDate QLocale::toDate(const QString& string) const.

C++ documentation:

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

source

pub unsafe fn to_date_q_string_format_type_q_calendar( &self, string: impl CastInto<Ref<QString>>, format: FormatType, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QDate>

Available on cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QDate QLocale::toDate(const QString& string, QLocale::FormatType format, QCalendar cal) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.14.

source

pub unsafe fn to_date_2_q_string_q_calendar( &self, string: impl CastInto<Ref<QString>>, format: impl CastInto<Ref<QString>>, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QDate>

Available on cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QDate QLocale::toDate(const QString& string, const QString& format, QCalendar cal) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.14.

source

pub unsafe fn to_date_time_q_string_format_type( &self, string: impl CastInto<Ref<QString>>, format: FormatType ) -> CppBox<QDateTime>

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

Calls C++ function: QDateTime QLocale::toDateTime(const QString& string, QLocale::FormatType format = …) const.

C++ documentation:

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

source

pub unsafe fn to_date_time_2_q_string( &self, string: impl CastInto<Ref<QString>>, format: impl CastInto<Ref<QString>> ) -> CppBox<QDateTime>

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.

Calls C++ function: QDateTime QLocale::toDateTime(const QString& string, const QString& format) const.

C++ documentation:

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

source

pub unsafe fn to_date_time_q_string( &self, string: impl CastInto<Ref<QString>> ) -> CppBox<QDateTime>

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

Calls C++ function: QDateTime QLocale::toDateTime(const QString& string) const.

C++ documentation:

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

source

pub unsafe fn to_date_time_q_string_format_type_q_calendar( &self, string: impl CastInto<Ref<QString>>, format: FormatType, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QDateTime>

Available on cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QDateTime QLocale::toDateTime(const QString& string, QLocale::FormatType format, QCalendar cal) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.14.

source

pub unsafe fn to_date_time_2_q_string_q_calendar( &self, string: impl CastInto<Ref<QString>>, format: impl CastInto<Ref<QString>>, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QDateTime>

Available on cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QDateTime QLocale::toDateTime(const QString& string, const QString& format, QCalendar cal) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.14.

source

pub unsafe fn to_double_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_double

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: double QLocale::toDouble(const QString& s, bool* ok = …) const.

C++ documentation:

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 use 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().

source

pub unsafe fn to_double_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_double

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: double QLocale::toDouble(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

If ok is not null, 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.

This function was introduced in Qt 5.1.

See also toFloat(), toInt(), and toString().

source

pub unsafe fn to_double_q_string( &self, s: impl CastInto<Ref<QString>> ) -> c_double

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: double QLocale::toDouble(const QString& s) const.

C++ documentation:

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 use 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().

source

pub unsafe fn to_double_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_double

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: double QLocale::toDouble(const QStringRef& s) const.

C++ documentation:

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

If ok is not null, 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.

This function was introduced in Qt 5.1.

See also toFloat(), toInt(), and toString().

source

pub unsafe fn to_double_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_double

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: double QLocale::toDouble(QStringView s, bool* ok = …) const.

C++ documentation:

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

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.

bool ok; double d;

QLocale c(QLocale::C); d = c.toDouble(u“1234.56”, &ok); // ok == true, d == 1234.56 d = c.toDouble(u“1,234.56”, &ok); // ok == true, d == 1234.56 d = c.toDouble(u“1234,56”, &ok); // ok == false

QLocale german(QLocale::German); d = german.toDouble(u“1234,56”, &ok); // ok == true, d == 1234.56 d = german.toDouble(u“1.234,56”, &ok); // ok == true, d == 1234.56 d = german.toDouble(u“1234.56”, &ok); // ok == false

d = german.toDouble(u“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.

This function was introduced in Qt 5.10.

See also toFloat(), toInt(), and toString().

source

pub unsafe fn to_double_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_double

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: double QLocale::toDouble(QStringView s) const.

C++ documentation:

Returns the double represented by the localized string s, or 0.0 if the conversion failed.

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.

bool ok; double d;

QLocale c(QLocale::C); d = c.toDouble(u“1234.56”, &ok); // ok == true, d == 1234.56 d = c.toDouble(u“1,234.56”, &ok); // ok == true, d == 1234.56 d = c.toDouble(u“1234,56”, &ok); // ok == false

QLocale german(QLocale::German); d = german.toDouble(u“1234,56”, &ok); // ok == true, d == 1234.56 d = german.toDouble(u“1.234,56”, &ok); // ok == true, d == 1234.56 d = german.toDouble(u“1234.56”, &ok); // ok == false

d = german.toDouble(u“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.

This function was introduced in Qt 5.10.

See also toFloat(), toInt(), and toString().

source

pub unsafe fn to_float_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_float

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: float QLocale::toFloat(const QString& s, bool* ok = …) const.

C++ documentation:

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

source

pub unsafe fn to_float_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_float

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: float QLocale::toFloat(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

If ok is not null, reports failure by setting *ok to false and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toDouble(), toInt(), and toString().

source

pub unsafe fn to_float_q_string( &self, s: impl CastInto<Ref<QString>> ) -> c_float

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: float QLocale::toFloat(const QString& s) const.

C++ documentation:

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

source

pub unsafe fn to_float_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_float

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: float QLocale::toFloat(const QStringRef& s) const.

C++ documentation:

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

If ok is not null, reports failure by setting *ok to false and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toDouble(), toInt(), and toString().

source

pub unsafe fn to_float_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_float

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: float QLocale::toFloat(QStringView s, bool* ok = …) const.

C++ documentation:

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

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.

This function was introduced in Qt 5.10.

See also toDouble(), toInt(), and toString().

source

pub unsafe fn to_float_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_float

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

Calls C++ function: float QLocale::toFloat(QStringView s) const.

C++ documentation:

Returns the float represented by the localized string s, or 0.0 if the conversion failed.

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.

This function was introduced in Qt 5.10.

See also toDouble(), toInt(), and toString().

source

pub unsafe fn to_int_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_int

Returns the int represented by the localized string s.

Calls C++ function: int QLocale::toInt(const QString& s, bool* ok = …) const.

C++ documentation:

Returns the int represented by the localized string s.

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

source

pub unsafe fn to_int_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_int

Returns the int represented by the localized string s.

Calls C++ function: int QLocale::toInt(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toUInt() and toString().

source

pub unsafe fn to_int_q_string(&self, s: impl CastInto<Ref<QString>>) -> c_int

Returns the int represented by the localized string s.

Calls C++ function: int QLocale::toInt(const QString& s) const.

C++ documentation:

Returns the int represented by the localized string s.

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

source

pub unsafe fn to_int_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_int

Returns the int represented by the localized string s.

Calls C++ function: int QLocale::toInt(const QStringRef& s) const.

C++ documentation:

Returns the int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toUInt() and toString().

source

pub unsafe fn to_int_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_int

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the int represented by the localized string s.

Calls C++ function: int QLocale::toInt(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toUInt() and toString().

source

pub unsafe fn to_int_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_int

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the int represented by the localized string s.

Calls C++ function: int QLocale::toInt(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toUInt() and toString().

source

pub unsafe fn to_long_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_long

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long int represented by the localized string s.

Calls C++ function: long QLocale::toLong(const QString& s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toInt(), toULong(), toDouble(), and toString().

source

pub unsafe fn to_long_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_long

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long int represented by the localized string s.

Calls C++ function: long QLocale::toLong(const QStringRef& s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toInt(), toULong(), toDouble(), and toString().

source

pub unsafe fn to_long_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_long

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long int represented by the localized string s.

Calls C++ function: long QLocale::toLong(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toInt(), toULong(), toDouble(), and toString().

source

pub unsafe fn to_long_q_string(&self, s: impl CastInto<Ref<QString>>) -> c_long

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long int represented by the localized string s.

Calls C++ function: long QLocale::toLong(const QString& s) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toInt(), toULong(), toDouble(), and toString().

source

pub unsafe fn to_long_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_long

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long int represented by the localized string s.

Calls C++ function: long QLocale::toLong(const QStringRef& s) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toInt(), toULong(), toDouble(), and toString().

source

pub unsafe fn to_long_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_long

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long int represented by the localized string s.

Calls C++ function: long QLocale::toLong(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toInt(), toULong(), toDouble(), and toString().

source

pub unsafe fn to_long_long_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> i64

Returns the long long int represented by the localized string s.

Calls C++ function: qlonglong QLocale::toLongLong(const QString& s, bool* ok = …) const.

C++ documentation:

Returns the long long int represented by the localized string s.

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

source

pub unsafe fn to_long_long_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> i64

Returns the long long int represented by the localized string s.

Calls C++ function: qlonglong QLocale::toLongLong(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the long long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toInt(), toULongLong(), toDouble(), and toString().

source

pub unsafe fn to_long_long_q_string( &self, s: impl CastInto<Ref<QString>> ) -> i64

Returns the long long int represented by the localized string s.

Calls C++ function: qlonglong QLocale::toLongLong(const QString& s) const.

C++ documentation:

Returns the long long int represented by the localized string s.

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

source

pub unsafe fn to_long_long_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> i64

Returns the long long int represented by the localized string s.

Calls C++ function: qlonglong QLocale::toLongLong(const QStringRef& s) const.

C++ documentation:

Returns the long long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toInt(), toULongLong(), toDouble(), and toString().

source

pub unsafe fn to_long_long_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> i64

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long long int represented by the localized string s.

Calls C++ function: qlonglong QLocale::toLongLong(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toInt(), toULongLong(), toDouble(), and toString().

source

pub unsafe fn to_long_long_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> i64

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the long long int represented by the localized string s.

Calls C++ function: qlonglong QLocale::toLongLong(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toInt(), toULongLong(), toDouble(), and toString().

source

pub unsafe fn to_lower( &self, str: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Returns a lowercase copy of str.

Calls C++ function: QString QLocale::toLower(const QString& str) const.

C++ documentation:

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.

This function was introduced in Qt 4.8.

See also QString::toLower().

source

pub unsafe fn to_short_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_short

Returns the short int represented by the localized string s.

Calls C++ function: short QLocale::toShort(const QString& s, bool* ok = …) const.

C++ documentation:

Returns the short int represented by the localized string s.

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

source

pub unsafe fn to_short_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_short

Returns the short int represented by the localized string s.

Calls C++ function: short QLocale::toShort(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the short int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toUShort() and toString().

source

pub unsafe fn to_short_q_string( &self, s: impl CastInto<Ref<QString>> ) -> c_short

Returns the short int represented by the localized string s.

Calls C++ function: short QLocale::toShort(const QString& s) const.

C++ documentation:

Returns the short int represented by the localized string s.

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

source

pub unsafe fn to_short_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_short

Returns the short int represented by the localized string s.

Calls C++ function: short QLocale::toShort(const QStringRef& s) const.

C++ documentation:

Returns the short int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toUShort() and toString().

source

pub unsafe fn to_short_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_short

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the short int represented by the localized string s.

Calls C++ function: short QLocale::toShort(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toUShort() and toString().

source

pub unsafe fn to_short_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_short

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the short int represented by the localized string s.

Calls C++ function: short QLocale::toShort(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toUShort() and toString().

source

pub unsafe fn to_string_i64(&self, i: i64) -> CppBox<QString>

Returns a localized string representation of i.

Calls C++ function: QString QLocale::toString(qlonglong i) const.

C++ documentation:

Returns a localized string representation of i.

See also toLongLong().

source

pub unsafe fn to_string_u64(&self, i: u64) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(qulonglong i) const.

C++ documentation:

This is an overloaded function.

See also toULongLong().

source

pub unsafe fn to_string_short(&self, i: c_short) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(short i) const.

C++ documentation:

This is an overloaded function.

See also toShort().

source

pub unsafe fn to_string_ushort(&self, i: c_ushort) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(unsigned short i) const.

C++ documentation:

This is an overloaded function.

See also toUShort().

source

pub unsafe fn to_string_int(&self, i: c_int) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(int i) const.

C++ documentation:

This is an overloaded function.

See also toInt().

source

pub unsafe fn to_string_uint(&self, i: c_uint) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(unsigned int i) const.

C++ documentation:

This is an overloaded function.

See also toUInt().

source

pub unsafe fn to_string_double_char_int( &self, i: c_double, f: c_char, prec: c_int ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(double i, char f = …, int prec = …) const.

C++ documentation:

This is an overloaded function.

f and prec have the same meaning as in QString::number(double, char, int).

See also toDouble().

source

pub unsafe fn to_string_float_char_int( &self, i: c_float, f: c_char, prec: c_int ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(float i, char f = …, int prec = …) const.

C++ documentation:

This is an overloaded function.

f and prec have the same meaning as in QString::number(double, char, int).

See also toDouble().

source

pub unsafe fn to_string_q_date_q_string( &self, date: impl CastInto<Ref<QDate>>, format_str: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Returns a localized string representation of the given date in the specified format. If format is an empty string, an empty string is returned.

Calls C++ function: QString QLocale::toString(const QDate& date, const QString& formatStr) const.

C++ documentation:

Returns a localized string representation of the given date in the specified format. If format is an empty string, an empty string is returned.

source

pub unsafe fn to_string_q_date_format_type( &self, date: impl CastInto<Ref<QDate>>, format: FormatType ) -> CppBox<QString>

Returns a localized string representation of the given date according to the specified format.

Calls C++ function: QString QLocale::toString(const QDate& date, QLocale::FormatType format = …) const.

C++ documentation:

Returns a localized string representation of the given date according to the specified format.

source

pub unsafe fn to_string_q_time_q_string( &self, time: impl CastInto<Ref<QTime>>, format_str: impl CastInto<Ref<QString>> ) -> CppBox<QString>

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.

Calls C++ function: QString QLocale::toString(const QTime& time, const QString& formatStr) const.

C++ documentation:

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.

source

pub unsafe fn to_string_q_time_format_type( &self, time: impl CastInto<Ref<QTime>>, format: FormatType ) -> CppBox<QString>

Returns a localized string representation of the given time in the specified format.

Calls C++ function: QString QLocale::toString(const QTime& time, QLocale::FormatType format = …) const.

C++ documentation:

Returns a localized string representation of the given time in the specified format.

source

pub unsafe fn to_string_q_date_time_format_type( &self, date_time: impl CastInto<Ref<QDateTime>>, format: FormatType ) -> CppBox<QString>

Returns a localized string representation of the given dateTime according to the specified format.

Calls C++ function: QString QLocale::toString(const QDateTime& dateTime, QLocale::FormatType format = …) const.

C++ documentation:

Returns a localized string representation of the given dateTime according to the specified format.

This function was introduced in Qt 4.4.

source

pub unsafe fn to_string_q_date_time_q_string( &self, date_time: impl CastInto<Ref<QDateTime>>, format: impl CastInto<Ref<QString>> ) -> CppBox<QString>

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.

Calls C++ function: QString QLocale::toString(const QDateTime& dateTime, const QString& format) const.

C++ documentation:

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.

source

pub unsafe fn to_string_double_char( &self, i: c_double, f: c_char ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(double i, char f = …) const.

C++ documentation:

This is an overloaded function.

f and prec have the same meaning as in QString::number(double, char, int).

See also toDouble().

source

pub unsafe fn to_string_double(&self, i: c_double) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(double i) const.

C++ documentation:

This is an overloaded function.

f and prec have the same meaning as in QString::number(double, char, int).

See also toDouble().

source

pub unsafe fn to_string_float_char( &self, i: c_float, f: c_char ) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(float i, char f = …) const.

C++ documentation:

This is an overloaded function.

f and prec have the same meaning as in QString::number(double, char, int).

See also toDouble().

source

pub unsafe fn to_string_float(&self, i: c_float) -> CppBox<QString>

This is an overloaded function.

Calls C++ function: QString QLocale::toString(float i) const.

C++ documentation:

This is an overloaded function.

f and prec have the same meaning as in QString::number(double, char, int).

See also toDouble().

source

pub unsafe fn to_string_q_date( &self, date: impl CastInto<Ref<QDate>> ) -> CppBox<QString>

Returns a localized string representation of the given date according to the specified format.

Calls C++ function: QString QLocale::toString(const QDate& date) const.

C++ documentation:

Returns a localized string representation of the given date according to the specified format.

source

pub unsafe fn to_string_q_time( &self, time: impl CastInto<Ref<QTime>> ) -> CppBox<QString>

Returns a localized string representation of the given time in the specified format.

Calls C++ function: QString QLocale::toString(const QTime& time) const.

C++ documentation:

Returns a localized string representation of the given time in the specified format.

source

pub unsafe fn to_string_q_date_time( &self, date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<QString>

Returns a localized string representation of the given dateTime according to the specified format.

Calls C++ function: QString QLocale::toString(const QDateTime& dateTime) const.

C++ documentation:

Returns a localized string representation of the given dateTime according to the specified format.

This function was introduced in Qt 4.4.

source

pub unsafe fn to_string_q_date_q_string_view( &self, date: impl CastInto<Ref<QDate>>, format_str: impl CastInto<Ref<QStringView>> ) -> CppBox<QString>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns a localized string representation of the given date in the specified format. If format is an empty string, an empty string is returned.

Calls C++ function: QString QLocale::toString(const QDate& date, QStringView formatStr) const.

C++ documentation:

Returns a localized string representation of the given date in the specified format. If format is an empty string, an empty string is returned.

This function was introduced in Qt 5.10.

See also QDate::toString().

source

pub unsafe fn to_string_q_time_q_string_view( &self, time: impl CastInto<Ref<QTime>>, format_str: impl CastInto<Ref<QStringView>> ) -> CppBox<QString>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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.

Calls C++ function: QString QLocale::toString(const QTime& time, QStringView formatStr) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also QTime::toString().

source

pub unsafe fn to_string_q_date_time_q_string_view( &self, date_time: impl CastInto<Ref<QDateTime>>, format: impl CastInto<Ref<QStringView>> ) -> CppBox<QString>

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

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.

Calls C++ function: QString QLocale::toString(const QDateTime& dateTime, QStringView format) const.

C++ documentation:

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 5.10.

See also QDateTime::toString(), QDate::toString(), and QTime::toString().

source

pub unsafe fn to_string_long(&self, i: c_long) -> CppBox<QString>

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QString QLocale::toString(long i) const.

C++ documentation:

This is an overloaded function.

See also toLong().

source

pub unsafe fn to_string_ulong(&self, i: c_ulong) -> CppBox<QString>

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QString QLocale::toString(unsigned long i) const.

C++ documentation:

This is an overloaded function.

See also toULong().

source

pub unsafe fn to_string_q_date_q_string_view_q_calendar( &self, date: impl CastInto<Ref<QDate>>, format_str: impl CastInto<Ref<QStringView>>, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QString>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QString QLocale::toString(const QDate& date, QStringView formatStr, QCalendar cal) const.

source

pub unsafe fn to_string_q_date_format_type_q_calendar( &self, date: impl CastInto<Ref<QDate>>, format: FormatType, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QString>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QString QLocale::toString(const QDate& date, QLocale::FormatType format, QCalendar cal) const.

source

pub unsafe fn to_string_q_date_time_format_type_q_calendar( &self, date_time: impl CastInto<Ref<QDateTime>>, format: FormatType, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QString>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QString QLocale::toString(const QDateTime& dateTime, QLocale::FormatType format, QCalendar cal) const.

source

pub unsafe fn to_string_q_date_time_q_string_view_q_calendar( &self, date_time: impl CastInto<Ref<QDateTime>>, format_str: impl CastInto<Ref<QStringView>>, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QString>

Available on cpp_lib_version="5.14.0" only.

Calls C++ function: QString QLocale::toString(const QDateTime& dateTime, QStringView formatStr, QCalendar cal) const.

source

pub unsafe fn to_time_q_string_format_type( &self, string: impl CastInto<Ref<QString>>, arg2: FormatType ) -> CppBox<QTime>

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

Calls C++ function: QTime QLocale::toTime(const QString& string, QLocale::FormatType arg2 = …) const.

C++ documentation:

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

source

pub unsafe fn to_time_2_q_string( &self, string: impl CastInto<Ref<QString>>, format: impl CastInto<Ref<QString>> ) -> CppBox<QTime>

Parses the time string given in string and returns the time. See QTime::fromString() for information on what is a valid format string.

Calls C++ function: QTime QLocale::toTime(const QString& string, const QString& format) const.

C++ documentation:

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

source

pub unsafe fn to_time_q_string( &self, string: impl CastInto<Ref<QString>> ) -> CppBox<QTime>

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

Calls C++ function: QTime QLocale::toTime(const QString& string) const.

C++ documentation:

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

source

pub unsafe fn to_time_q_string_format_type_q_calendar( &self, string: impl CastInto<Ref<QString>>, format: FormatType, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QTime>

Available on cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QTime QLocale::toTime(const QString& string, QLocale::FormatType format, QCalendar cal) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.14.

source

pub unsafe fn to_time_2_q_string_q_calendar( &self, string: impl CastInto<Ref<QString>>, format: impl CastInto<Ref<QString>>, cal: impl CastInto<Ref<QCalendar>> ) -> CppBox<QTime>

Available on cpp_lib_version="5.14.0" only.

This is an overloaded function.

Calls C++ function: QTime QLocale::toTime(const QString& string, const QString& format, QCalendar cal) const.

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 5.14.

source

pub unsafe fn to_u_int_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_uint

Returns the unsigned int represented by the localized string s.

Calls C++ function: unsigned int QLocale::toUInt(const QString& s, bool* ok = …) const.

C++ documentation:

Returns the unsigned int represented by the localized string s.

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

source

pub unsafe fn to_u_int_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_uint

Returns the unsigned int represented by the localized string s.

Calls C++ function: unsigned int QLocale::toUInt(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the unsigned int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toInt() and toString().

source

pub unsafe fn to_u_int_q_string(&self, s: impl CastInto<Ref<QString>>) -> c_uint

Returns the unsigned int represented by the localized string s.

Calls C++ function: unsigned int QLocale::toUInt(const QString& s) const.

C++ documentation:

Returns the unsigned int represented by the localized string s.

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

source

pub unsafe fn to_u_int_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_uint

Returns the unsigned int represented by the localized string s.

Calls C++ function: unsigned int QLocale::toUInt(const QStringRef& s) const.

C++ documentation:

Returns the unsigned int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toInt() and toString().

source

pub unsafe fn to_u_int_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_uint

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned int represented by the localized string s.

Calls C++ function: unsigned int QLocale::toUInt(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toInt() and toString().

source

pub unsafe fn to_u_int_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_uint

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned int represented by the localized string s.

Calls C++ function: unsigned int QLocale::toUInt(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toInt() and toString().

source

pub unsafe fn to_u_long_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_ulong

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long int represented by the localized string s.

Calls C++ function: unsigned long QLocale::toULong(const QString& s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_ulong

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long int represented by the localized string s.

Calls C++ function: unsigned long QLocale::toULong(const QStringRef& s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_ulong

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long int represented by the localized string s.

Calls C++ function: unsigned long QLocale::toULong(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_q_string( &self, s: impl CastInto<Ref<QString>> ) -> c_ulong

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long int represented by the localized string s.

Calls C++ function: unsigned long QLocale::toULong(const QString& s) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_ulong

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long int represented by the localized string s.

Calls C++ function: unsigned long QLocale::toULong(const QStringRef& s) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_ulong

Available on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long int represented by the localized string s.

Calls C++ function: unsigned long QLocale::toULong(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.13.

See also toLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_long_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> u64

Returns the unsigned long long int represented by the localized string s.

Calls C++ function: qulonglong QLocale::toULongLong(const QString& s, bool* ok = …) const.

C++ documentation:

Returns the unsigned long long int represented by the localized string s.

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

source

pub unsafe fn to_u_long_long_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> u64

Returns the unsigned long long int represented by the localized string s.

Calls C++ function: qulonglong QLocale::toULongLong(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the unsigned long long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toLongLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_long_q_string( &self, s: impl CastInto<Ref<QString>> ) -> u64

Returns the unsigned long long int represented by the localized string s.

Calls C++ function: qulonglong QLocale::toULongLong(const QString& s) const.

C++ documentation:

Returns the unsigned long long int represented by the localized string s.

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

source

pub unsafe fn to_u_long_long_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> u64

Returns the unsigned long long int represented by the localized string s.

Calls C++ function: qulonglong QLocale::toULongLong(const QStringRef& s) const.

C++ documentation:

Returns the unsigned long long int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toLongLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_long_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> u64

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long long int represented by the localized string s.

Calls C++ function: qulonglong QLocale::toULongLong(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toLongLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_long_long_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> u64

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned long long int represented by the localized string s.

Calls C++ function: qulonglong QLocale::toULongLong(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toLongLong(), toInt(), toDouble(), and toString().

source

pub unsafe fn to_u_short_q_string_bool( &self, s: impl CastInto<Ref<QString>>, ok: *mut bool ) -> c_ushort

Returns the unsigned short int represented by the localized string s.

Calls C++ function: unsigned short QLocale::toUShort(const QString& s, bool* ok = …) const.

C++ documentation:

Returns the unsigned short int represented by the localized string s.

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

source

pub unsafe fn to_u_short_q_string_ref_bool( &self, s: impl CastInto<Ref<QStringRef>>, ok: *mut bool ) -> c_ushort

Returns the unsigned short int represented by the localized string s.

Calls C++ function: unsigned short QLocale::toUShort(const QStringRef& s, bool* ok = …) const.

C++ documentation:

Returns the unsigned short int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toShort() and toString().

source

pub unsafe fn to_u_short_q_string( &self, s: impl CastInto<Ref<QString>> ) -> c_ushort

Returns the unsigned short int represented by the localized string s.

Calls C++ function: unsigned short QLocale::toUShort(const QString& s) const.

C++ documentation:

Returns the unsigned short int represented by the localized string s.

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

source

pub unsafe fn to_u_short_q_string_ref( &self, s: impl CastInto<Ref<QStringRef>> ) -> c_ushort

Returns the unsigned short int represented by the localized string s.

Calls C++ function: unsigned short QLocale::toUShort(const QStringRef& s) const.

C++ documentation:

Returns the unsigned short int represented by the localized string s.

If the conversion fails the function returns 0.

If ok is not null, failure is reported by setting *ok to false, and success by setting *ok to true.

This function ignores leading and trailing whitespace.

This function was introduced in Qt 5.1.

See also toShort() and toString().

source

pub unsafe fn to_u_short_q_string_view_bool( &self, s: impl CastInto<Ref<QStringView>>, ok: *mut bool ) -> c_ushort

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned short int represented by the localized string s.

Calls C++ function: unsigned short QLocale::toUShort(QStringView s, bool* ok = …) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toShort() and toString().

source

pub unsafe fn to_u_short_q_string_view( &self, s: impl CastInto<Ref<QStringView>> ) -> c_ushort

Available on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the unsigned short int represented by the localized string s.

Calls C++ function: unsigned short QLocale::toUShort(QStringView s) const.

C++ documentation:

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.

This function was introduced in Qt 5.10.

See also toShort() and toString().

source

pub unsafe fn to_upper( &self, str: impl CastInto<Ref<QString>> ) -> CppBox<QString>

Returns an uppercase copy of str.

Calls C++ function: QString QLocale::toUpper(const QString& str) const.

C++ documentation:

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.

This function was introduced in Qt 4.8.

See also QString::toUpper().

source

pub unsafe fn ui_languages(&self) -> CppBox<QStringList>

Returns an ordered list of locale names for translation purposes in preference order (like "en-Latn-US", "en-US", "en").

Calls C++ function: QStringList QLocale::uiLanguages() const.

C++ documentation:

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.

This function was introduced in Qt 4.8.

See also QTranslator and bcp47Name().

source

pub unsafe fn weekdays(&self) -> CppBox<QListOfDayOfWeek>

Returns a list of days that are considered weekdays according to the current locale.

Calls C++ function: QList<Qt::DayOfWeek> QLocale::weekdays() const.

C++ documentation:

Returns a list of days that are considered weekdays according to the current locale.

This function was introduced in Qt 4.8.

source

pub unsafe fn zero_digit(&self) -> CppBox<QChar>

Returns the zero digit character of this locale.

Calls C++ function: QChar QLocale::zeroDigit() const.

C++ documentation:

Returns the zero digit character of this locale.

This function was introduced in Qt 4.1.

Trait Implementations§

source§

impl CppDeletable for QLocale

source§

unsafe fn delete(&self)

Destructor

Calls C++ function: [destructor] void QLocale::~QLocale().

C++ documentation:

Destructor

source§

impl PartialEq<Ref<QLocale>> for QLocale

source§

fn eq(&self, other: &Ref<QLocale>) -> bool

Returns true if the QLocale object is the same as the other locale specified; otherwise returns false.

Calls C++ function: bool QLocale::operator==(const QLocale& other) const.

C++ documentation:

Returns true if the QLocale object is the same as the other locale specified; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.