LocaleItem Class

The LocaleItem class represents a locale. More...

Header: #include <LocaleItem>
qmake: QT += localesettings
Inherits: QObject

Properties

Public Functions

LocaleItem(const QLocale &locale, QObject *parent = Q_NULLPTR)
QString code() const
QString country() const
QString language() const

Detailed Description

This class holds the name, language, and country code of a locale.

If available, the native country name and language are used. For example, Deutsch and Deutschland for the German locale.

See also QLocale and LocaleModel.

Property Documentation

code : const QString

This property holds the locale code string.

The locale code is in the format 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.

Access functions:

QString code() const

See also QLocale::name().

country : const QString

This property holds the name of the country.

Access functions:

QString country() const

See also QLocale::Country.

language : const QString

This property holds the name of the language.

Access functions:

QString language() const

See also QLocale::Language.

Member Function Documentation

LocaleItem::LocaleItem(const QLocale &locale, QObject *parent = Q_NULLPTR)

Creates the locale item locale with the parent parent.

QString LocaleItem::code() const

Returns the country code of the country.

Note: Getter function for property code.

QString LocaleItem::country() const

Returns the name of the country.

Note: Getter function for property country.

QString LocaleItem::language() const

Returns the language of the country.

Note: Getter function for property language.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.