QGeoAddress

Since: 1.1

#include <QtLocationSubset/QGeoAddress>

The QGeoAddress class represents an address.

This class represents an address of a location. Note that the methods text(), setText() and isTextGenerated() have been included here from the Qt 5.0 version of QGeoAddress, to satisfy the requirements of the BB10 QGeoServiceProvider (BbGeoServices).


Overview

Public Functions Index

QGeoAddress ()
QGeoAddress (const QGeoAddress &other)
~QGeoAddress ()
QStringcity () const
voidclear ()
QStringcountry () const
QStringcountryCode () const
QStringcounty () const
QStringdistrict () const
boolisEmpty () const
boolisTextGenerated () const
booloperator!= (const QGeoAddress &other) const
QGeoAddress &operator= (const QGeoAddress &other)
booloperator== (const QGeoAddress &other) const
QStringpostcode () const
voidsetCity (const QString &city)
voidsetCountry (const QString &country)
voidsetCountryCode (const QString &countryCode)
voidsetCounty (const QString &county)
voidsetDistrict (const QString &district)
voidsetPostcode (const QString &postcode)
voidsetState (const QString &state)
voidsetStreet (const QString &street)
voidsetText (const QString &text)
QStringstate () const
QStringstreet () const
QStringtext () const

Public Functions

QGeoAddress ()

Default constructor.

QGeoAddress (

Constructs a copy of other.

~QGeoAddress ()

Destructor.

QString city ()

Returns the city.

void clear ()

Clears all the address' data fields.

QString country ()

Returns the country name.

QString countryCode ()

Returns the country code according to ISO 3166-1 alpha-3.

QString county ()

Returns the county.

The county is considered the second subdivision below country.

QString district ()

Returns the district.

The district is considered the subdivison below city.

bool isEmpty ()

Returns whether this address is empty.

An address is considered empty if all of its fields are empty.

bool isTextGenerated ()

Returns true if QGeoAddress::text() is automatically generated from address elements, otherwise returns false if text() has been explicitly assigned.

See also:

text(), setText() Note that this method has been included here from the Qt 5.0 version of QGeoAddress, to satisfy the requirements of the BB10 QGeoServiceProvider (BbGeoServices).

bool operator!= (

Returns true if this address is not equal to other, otherwise returns false.

QGeoAddress & operator= (

Assigns the given address to this address and returns a reference to this address.

bool operator== (

Returns true if this address is equal to other, otherwise returns false.

QString postcode ()

Returns the postal code.

void setCity (

Sets the city.

void setCountry (

Sets the country name.

void setCountryCode (

Sets the countryCode according to ISO 3166-1 alpha-3.

void setCounty (

Sets the county.

void setDistrict (

Sets the district.

void setPostcode (

Sets the postcode.

void setState (

Sets the state.

void setStreet (

Sets the street-level component of the address to street.

This typically includes a street number and street name but may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.

void setText (

If text is not empty, explicitly assigns text as the string to be returned by text().

isTextGenerated() will return false. If text is empty, indicates that text() should be automatically generated from the address elements. isTextGenerated() will return true. Note that this method has been included here from the Qt 5.0 version of QGeoAddress, to satisfy the requirements of the BB10 QGeoServiceProvider (BbGeoServices).

QString state ()

Returns the state.

The state is considered the first subdivision below country.

QString street ()

Returns the street-level component of the address.

This typically includes a street number and street name but may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.

QString text ()

Returns the address as a single formatted string.

It is the recommended string to use to display the address to the user. It typically takes the format of an address as found on an envelope, but this is not always necessarily the case. The adddress text is either automatically generated or explicitly assigned. This can be determined by checking {QGeoAddress::isTextGenerated()} {isTextGenerated}. If an empty string is provided to setText(), then isTextGenerated() will be set to true and text() will return a string which is locally formatted according to countryCode() and based on the elements of the address such as street, city and so on. Because the text string is generated from the address elements, a sequence of calls such as text(), setStreet(), text() may return different strings for each invocation of text(). If a non-empty string is provided to setText(), then isTextGenerated() will be set to false and text() will always return the explicitly assigned string. Calls to modify other elements such as setStreet(), setCity() and so on will not affect the resultant string from text(). Note that this method has been included here from the Qt 5.0 version of QGeoAddress, to satisfy the requirements of the BB10 QGeoServiceProvider (BbGeoServices).

Last modified: 2014-03-13

comments powered by Disqus