KCountrySubdivision
#include <KCountrySubdivision>
Properties | |
QString | code |
KCountry | country |
QString | name |
KCountrySubdivision | parent |
QList< KCountrySubdivision > | subdivisions |
QStringList | timeZoneIds |
Public Member Functions | |
KCountrySubdivision () | |
KCountrySubdivision (const KCountrySubdivision &) | |
QString | code () const |
KCountry | country () const |
bool | isValid () const |
QString | name () const |
bool | operator!= (const KCountrySubdivision &other) const |
KCountrySubdivision & | operator= (const KCountrySubdivision &) |
bool | operator== (const KCountrySubdivision &other) const |
KCountrySubdivision | parent () const |
QList< KCountrySubdivision > | subdivisions () const |
QList< const char * > | timeZoneIds () const |
Static Public Member Functions | |
static KCountrySubdivision | fromCode (const char *code) |
static KCountrySubdivision | fromCode (QStringView code) |
static KCountrySubdivision | fromLocation (float latitude, float longitude) |
Detailed Description
Information about an ISO 3166-2 country subdivision.
- Note
- This requires the iso-codes data files and translation catalogs to be available at runtime.
- See also
- KCountry for the data sources.
- Since
- 5.88
Definition at line 27 of file kcountrysubdivision.h.
Property Documentation
◆ code
|
read |
Definition at line 30 of file kcountrysubdivision.h.
◆ country
|
read |
Definition at line 32 of file kcountrysubdivision.h.
◆ name
|
read |
Definition at line 31 of file kcountrysubdivision.h.
◆ parent
|
read |
Definition at line 33 of file kcountrysubdivision.h.
◆ subdivisions
|
read |
Definition at line 34 of file kcountrysubdivision.h.
◆ timeZoneIds
|
read |
Definition at line 35 of file kcountrysubdivision.h.
Constructor & Destructor Documentation
◆ KCountrySubdivision()
KCountrySubdivision::KCountrySubdivision | ( | ) |
Creates an invalid/empty KCountrySubdivision instance.
See the fromX() methods for creating a valid instance.
Definition at line 20 of file kcountrysubdivision.cpp.
Member Function Documentation
◆ code()
QString KCountrySubdivision::code | ( | ) | const |
ISO 3166-2 country subdivision code.
Definition at line 44 of file kcountrysubdivision.cpp.
◆ country()
KCountry KCountrySubdivision::country | ( | ) | const |
Country this subdivision belongs to.
Definition at line 82 of file kcountrysubdivision.cpp.
◆ fromCode() [1/2]
|
static |
Create a KCountrySubdivision instance from an ISO 3166-2 code.
Definition at line 180 of file kcountrysubdivision.cpp.
◆ fromCode() [2/2]
|
static |
Create a KCountrySubdivision instance from an ISO 3166-2 code.
Definition at line 173 of file kcountrysubdivision.cpp.
◆ fromLocation()
|
static |
Looks up the country subdivision at the given geographic coordinate.
This can return an invalid object if the country subdivision could not be determined. This can happen in a number of cases:
- on oceans
- in polar regions
- close to a land border
- in disputed territories
- Note
- It is possible for KCountry::fromLocation() to return a valid result despite this method returning an invalid result.
Definition at line 189 of file kcountrysubdivision.cpp.
◆ isValid()
bool KCountrySubdivision::isValid | ( | ) | const |
Returns false
if this is an empty/invalid/default constructed instance, true
otherwise.
Definition at line 39 of file kcountrysubdivision.cpp.
◆ name()
QString KCountrySubdivision::name | ( | ) | const |
Translated country subdivision name.
Definition at line 67 of file kcountrysubdivision.cpp.
◆ operator!=()
bool KCountrySubdivision::operator!= | ( | const KCountrySubdivision & | other | ) | const |
Definition at line 34 of file kcountrysubdivision.cpp.
◆ operator==()
bool KCountrySubdivision::operator== | ( | const KCountrySubdivision & | other | ) | const |
Definition at line 29 of file kcountrysubdivision.cpp.
◆ parent()
KCountrySubdivision KCountrySubdivision::parent | ( | ) | const |
Parent subdivision, if this is a subdivision of another subdivision.
Returns an invalid element for top-level subdivisions.
Definition at line 89 of file kcountrysubdivision.cpp.
◆ subdivisions()
QList< KCountrySubdivision > KCountrySubdivision::subdivisions | ( | ) | const |
Subdivisions of this subdivision, if any.
This is only relevant for countries with multiple ISO 3166-2 subdivision levels.
Definition at line 131 of file kcountrysubdivision.cpp.
◆ timeZoneIds()
QList< const char * > KCountrySubdivision::timeZoneIds | ( | ) | const |
Timezones in use in this country subdivision.
Definition at line 107 of file kcountrysubdivision.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.