Search for usage in LXR

#include <KCountrySubdivision>


QString code
KCountry country
QString name
KCountrySubdivision parent
QList< KCountrySubdivisionsubdivisions
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
KCountrySubdivisionoperator= (const KCountrySubdivision &)
bool operator== (const KCountrySubdivision &other) const
KCountrySubdivision parent () const
QList< KCountrySubdivisionsubdivisions () 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.

This requires the iso-codes data files and translation catalogs to be available at runtime.
See also
KCountry for the data sources.

Definition at line 27 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.

◆ country()

KCountry KCountrySubdivision::country ( ) const

Country this subdivision belongs to.

◆ fromCode() [1/2]

KCountrySubdivision KCountrySubdivision::fromCode ( const char *  code)

Create a KCountrySubdivision instance from an ISO 3166-2 code.

Definition at line 180 of file kcountrysubdivision.cpp.

◆ fromCode() [2/2]

KCountrySubdivision KCountrySubdivision::fromCode ( QStringView  code)

Create a KCountrySubdivision instance from an ISO 3166-2 code.

Definition at line 173 of file kcountrysubdivision.cpp.

◆ fromLocation()

KCountrySubdivision KCountrySubdivision::fromLocation ( float  latitude,
float  longitude 

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

◆ parent()

KCountrySubdivision KCountrySubdivision::parent ( ) const

Parent subdivision, if this is a subdivision of another subdivision.

Returns an invalid element for top-level subdivisions.

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

◆ timeZoneIds()

QList<const char *> KCountrySubdivision::timeZoneIds ( ) const

Timezones in use in this country subdivision.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 03:59:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.