![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtPositioning More...
#include <qgeoaddress.h>
Public Member Functions | |
QGeoAddress () | |
Default constructor. | |
QGeoAddress (const QGeoAddress &other) | |
Constructs a copy of other. | |
QGeoAddress (QGeoAddress &&other) noexcept=default | |
~QGeoAddress () | |
Destroys this address. | |
QGeoAddress & | operator= (const QGeoAddress &other) |
Assigns the given address to this address and returns a reference to this address. | |
void | swap (QGeoAddress &other) noexcept |
QString | text () const |
Returns the address as a single formatted string. | |
void | setText (const QString &text) |
If text is not empty, explicitly assigns text as the string to be returned by text(). | |
QString | country () const |
Returns the country name. | |
void | setCountry (const QString &country) |
Sets the country name. | |
QString | countryCode () const |
Returns the country code according to ISO 3166-1 alpha-3. | |
void | setCountryCode (const QString &countryCode) |
Sets the countryCode according to ISO 3166-1 alpha-3. | |
QString | state () const |
Returns the state. | |
void | setState (const QString &state) |
Sets the state. | |
QString | county () const |
Returns the county. | |
void | setCounty (const QString &county) |
Sets the county. | |
QString | city () const |
Returns the city. | |
void | setCity (const QString &city) |
Sets the city. | |
QString | district () const |
Returns the district. | |
void | setDistrict (const QString &district) |
Sets the district. | |
QString | postalCode () const |
Returns the postal code. | |
void | setPostalCode (const QString &postalCode) |
Sets the postalCode. | |
QString | street () const |
Returns the street name. | |
void | setStreet (const QString &street) |
Sets the street name to street. | |
QString | streetNumber () const |
void | setStreetNumber (const QString &streetNumber) |
bool | isEmpty () const |
Returns whether this address is empty. | |
void | clear () |
Clears all of the address' data fields. | |
bool | isTextGenerated () const |
Returns true if QGeoAddress::text() is automatically generated from address elements, otherwise returns false if text() has been explicitly assigned. | |
Friends | |
bool | operator== (const QGeoAddress &lhs, const QGeoAddress &rhs) |
Returns true if lhs address is equal to rhs, otherwise returns false . | |
bool | operator!= (const QGeoAddress &lhs, const QGeoAddress &rhs) |
Returns true if lhs address is not equal to rhs, otherwise returns false . | |
Related Symbols | |
(Note that these are not member symbols.) | |
size_t | qHash (const QGeoAddress &address, size_t seed) noexcept |
Returns the hash value for the address, using seed for the calculation. | |
\inmodule QtPositioning
The QGeoAddress class represents an address of a \l QGeoLocation.
The address' attributes are normalized to US feature names and can be mapped to the local feature levels (for example State matches "Bundesland" in Germany).
The address contains a \l text() for displaying purposes and additional properties to access the components of an address:
\list
Definition at line 17 of file qgeoaddress.h.
QGeoAddress::QGeoAddress | ( | ) |
Default constructor.
Definition at line 364 of file qgeoaddress.cpp.
QGeoAddress::QGeoAddress | ( | const QGeoAddress & | other | ) |
Constructs a copy of other.
Definition at line 372 of file qgeoaddress.cpp.
|
defaultnoexcept |
Constructs a geo address object by moving from other.
QGeoAddress::~QGeoAddress | ( | ) |
Destroys this address.
Definition at line 409 of file qgeoaddress.cpp.
QString QGeoAddress::city | ( | ) | const |
Returns the city.
Definition at line 549 of file qgeoaddress.cpp.
void QGeoAddress::clear | ( | ) |
Clears all of the address' data fields.
Definition at line 676 of file qgeoaddress.cpp.
QString QGeoAddress::country | ( | ) | const |
Returns the country name.
Definition at line 485 of file qgeoaddress.cpp.
QString QGeoAddress::countryCode | ( | ) | const |
Returns the country code according to ISO 3166-1 alpha-3.
Definition at line 501 of file qgeoaddress.cpp.
QString QGeoAddress::county | ( | ) | const |
Returns the county.
The county is considered the second subdivision below country.
Definition at line 533 of file qgeoaddress.cpp.
QString QGeoAddress::district | ( | ) | const |
Returns the district.
The district is considered the subdivison below city.
Definition at line 565 of file qgeoaddress.cpp.
bool QGeoAddress::isEmpty | ( | ) | const |
Returns whether this address is empty.
An address is considered empty if all of its fields are empty.
Definition at line 658 of file qgeoaddress.cpp.
bool QGeoAddress::isTextGenerated | ( | ) | const |
Returns true if QGeoAddress::text() is automatically generated from address elements, otherwise returns false if text() has been explicitly assigned.
Definition at line 696 of file qgeoaddress.cpp.
QGeoAddress & QGeoAddress::operator= | ( | const QGeoAddress & | other | ) |
Assigns the given address to this address and returns a reference to this address.
Move-assigns the other to this address and returns a reference to this address.
Definition at line 419 of file qgeoaddress.cpp.
QString QGeoAddress::postalCode | ( | ) | const |
Returns the postal code.
Definition at line 641 of file qgeoaddress.cpp.
Sets the city.
Definition at line 557 of file qgeoaddress.cpp.
Sets the country name.
Definition at line 493 of file qgeoaddress.cpp.
Sets the countryCode according to ISO 3166-1 alpha-3.
Definition at line 509 of file qgeoaddress.cpp.
Sets the county.
Definition at line 541 of file qgeoaddress.cpp.
Sets the district.
Definition at line 573 of file qgeoaddress.cpp.
Sets the postalCode.
Definition at line 649 of file qgeoaddress.cpp.
Sets the state.
Definition at line 525 of file qgeoaddress.cpp.
Sets the street name to street.
Definition at line 601 of file qgeoaddress.cpp.
This may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.
Definition at line 633 of file qgeoaddress.cpp.
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.
Definition at line 477 of file qgeoaddress.cpp.
QString QGeoAddress::state | ( | ) | const |
Returns the state.
The state is considered the first subdivision below country.
Definition at line 517 of file qgeoaddress.cpp.
QString QGeoAddress::street | ( | ) | const |
Returns the street name.
Definition at line 587 of file qgeoaddress.cpp.
QString QGeoAddress::streetNumber | ( | ) | const |
This may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.
Definition at line 617 of file qgeoaddress.cpp.
|
inlinenoexcept |
Definition at line 28 of file qgeoaddress.h.
QString QGeoAddress::text | ( | ) | const |
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 address text is either automatically generated or explicitly assigned. This can be determined by checking \l {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().
Definition at line 462 of file qgeoaddress.cpp.
|
friend |
Returns true
if lhs address is not equal to rhs, otherwise returns false
.
Definition at line 34 of file qgeoaddress.h.
|
friend |
Returns true
if lhs address is equal to rhs, otherwise returns false
.
Definition at line 30 of file qgeoaddress.h.
|
Returns the hash value for the address, using seed for the calculation.
Definition at line 734 of file qgeoaddress.cpp.