QGeoLocation Class

The QGeoLocation class represents basic information about a location. More...

Header: #include <QGeoLocation>
qmake: QT += positioning
Since: Qt 5.2

This class was introduced in Qt 5.2.

Public Functions

QGeoLocation(const QGeoLocation &other)
QGeoLocation &operator=(const QGeoLocation &other)
QGeoAddress address() const
QGeoRectangle boundingBox() const
QGeoCoordinate coordinate() const
QVariantMap extendedAttributes() const
bool isEmpty() const
void setAddress(const QGeoAddress &address)
void setBoundingBox(const QGeoRectangle &boundingBox)
void setCoordinate(const QGeoCoordinate &coordinate)
void setExtendedAttributes(const QVariantMap &data)
bool operator!=(const QGeoLocation &other) const
bool operator==(const QGeoLocation &other) const

Detailed Description

A QGeoLocation consists of a coordinate and corresponding address, along with an optional bounding box which is the recommended region to be displayed when viewing the location.

Member Function Documentation

QGeoLocation::QGeoLocation(const QGeoLocation &other)

Constructs a copy of other


Constructs an new location object.

QGeoLocation &QGeoLocation::operator=(const QGeoLocation &other)

Assigns other to this location and returns a reference to this location.


Destroys the location object.

QGeoAddress QGeoLocation::address() const

Returns the address of the location.

See also setAddress().

QGeoRectangle QGeoLocation::boundingBox() const

Returns a bounding box which represents the recommended region to display when viewing this location.

For example, a building's location may have a region centered around the building, but the region is large enough to show it's immediate surrounding geographical context.

See also setBoundingBox().

QGeoCoordinate QGeoLocation::coordinate() const

Returns the coordinate of the location.

See also setCoordinate().

QVariantMap QGeoLocation::extendedAttributes() const

Returns the extended attributes associated to this location. Extended attributes are backend-dependent and can be location-dependent.

This function was introduced in Qt 5.13.

See also setExtendedAttributes().

bool QGeoLocation::isEmpty() const

Returns true if all fields of the location are 0; otherwise returns false.

void QGeoLocation::setAddress(const QGeoAddress &address)

Sets the address of the location.

See also address().

void QGeoLocation::setBoundingBox(const QGeoRectangle &boundingBox)

Sets the boundingBox of the location.

See also boundingBox().

void QGeoLocation::setCoordinate(const QGeoCoordinate &coordinate)

Sets the coordinate of the location.

See also coordinate().

void QGeoLocation::setExtendedAttributes(const QVariantMap &data)

Sets the extended attributes of the location with the parameters specified in data.

This function was introduced in Qt 5.13.

See also extendedAttributes().

bool QGeoLocation::operator!=(const QGeoLocation &other) const

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

bool QGeoLocation::operator==(const QGeoLocation &other) const

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

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.