Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QLocaleId Struct Reference

#include <qlocale_p.h>

+ Collaboration diagram for QLocaleId:

Public Member Functions

bool operator== (QLocaleId other) const noexcept
 
bool operator!= (QLocaleId other) const noexcept
 
bool isValid () const noexcept
 
bool matchesAll () const noexcept
 
bool acceptLanguage (quint16 lang) const noexcept
 
bool acceptScriptTerritory (QLocaleId other) const noexcept
 
QLocaleId withLikelySubtagsAdded () const noexcept
 Fill in blank fields of a locale ID.
 
QLocaleId withLikelySubtagsRemoved () const noexcept
 
QByteArray name (char separator='-') const
 

Static Public Member Functions

static Q_AUTOTEST_EXPORT QLocaleId fromName (QStringView name) noexcept
 

Public Attributes

ushort language_id = 0
 
ushort script_id = 0
 
ushort territory_id = 0
 

Detailed Description

Definition at line 189 of file qlocale_p.h.

Member Function Documentation

◆ acceptLanguage()

bool QLocaleId::acceptLanguage ( quint16 lang) const
inlinenodiscardnoexcept

Definition at line 206 of file qlocale_p.h.

References language_id.

◆ acceptScriptTerritory()

bool QLocaleId::acceptScriptTerritory ( QLocaleId other) const
inlinenodiscardnoexcept

Definition at line 212 of file qlocale_p.h.

References script_id, and territory_id.

Referenced by contradicts().

+ Here is the caller graph for this function:

◆ fromName()

QLocaleId QLocaleId::fromName ( QStringView name)
staticnodiscardnoexcept

Definition at line 694 of file qlocale.cpp.

◆ isValid()

bool QLocaleId::isValid ( ) const
inlinenodiscardnoexcept

Definition at line 196 of file qlocale_p.h.

◆ matchesAll()

bool QLocaleId::matchesAll ( ) const
inlinenodiscardnoexcept

Definition at line 201 of file qlocale_p.h.

References language_id, script_id, and territory_id.

Referenced by withLikelySubtagsAdded().

+ Here is the caller graph for this function:

◆ name()

QByteArray QLocaleId::name ( char separator = '-') const
nodiscard

◆ operator!=()

bool QLocaleId::operator!= ( QLocaleId other) const
inlinenodiscardnoexcept

Definition at line 194 of file qlocale_p.h.

References operator==().

+ Here is the call graph for this function:

◆ operator==()

bool QLocaleId::operator== ( QLocaleId other) const
inlinenodiscardnoexcept

Definition at line 192 of file qlocale_p.h.

References language_id, script_id, and territory_id.

Referenced by operator!=(), and withLikelySubtagsRemoved().

+ Here is the caller graph for this function:

◆ withLikelySubtagsAdded()

QLocaleId QLocaleId::withLikelySubtagsAdded ( ) const
nodiscardnoexcept

Fill in blank fields of a locale ID.

An ID in which some fields are zero stands for any locale that agrees with it in its non-zero fields. CLDR's likely-subtag data is meant to help us chose which candidate to prefer. (Note, however, that CLDR does have some cases where it maps an ID to a "best match" for which CLDR does not provide data, even though there are locales for which CLDR does provide data that do match the given ID. It's telling us, unhelpfully but truthfully, what locale would (most likely) be meant by (someone using) the combination requested, even when that locale isn't yet supported.) It may also map an obsolete or generic tag to a modern or more specific replacement, possibly filling in some of the other fields in the process (presently only for countries). Note that some fields of the result may remain blank, but there is no more specific recommendation available.

For the formal specification, see https://www.unicode.org/reports/tr35/#Likely_Subtags

Note
We also search und_script_region and und_region; they're not mentioned in the spec, but the examples clearly presume them and CLDR does provide such likely matches.

Definition at line 321 of file qlocale.cpp.

References language_id, likely_subtags, matchesAll(), script_id, and territory_id.

Referenced by QLocaleData::findLocaleIndex(), and withLikelySubtagsRemoved().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withLikelySubtagsRemoved()

QLocaleId QLocaleId::withLikelySubtagsRemoved ( ) const
nodiscardnoexcept

Definition at line 410 of file qlocale.cpp.

References language_id, operator==(), script_id, territory_id, and withLikelySubtagsAdded().

Referenced by QLocalePrivate::bcp47Name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ language_id

◆ script_id

◆ territory_id


The documentation for this struct was generated from the following files: