QGeoLocation Class

The QGeoLocation class represents basic information about a location. 更多...

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

公共函数

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

详细描述

The QGeoLocation class represents basic information about a location.

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.

成员函数文档编制

QGeoLocation:: QGeoLocation ()

Constructs an new location object.

QGeoLocation:: QGeoLocation (const QGeoLocation & other )

构造副本为 other

QGeoLocation:: ~QGeoLocation ()

Destroys the location object.

QGeoAddress QGeoLocation:: address () const

Returns the address of the location.

另请参阅 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.

另请参阅 setBoundingBox ().

QGeoCoordinate QGeoLocation:: coordinate () const

Returns the coordinate of the location.

另请参阅 setCoordinate ().

bool QGeoLocation:: isEmpty () const

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

void QGeoLocation:: setAddress (const QGeoAddress & address )

设置 address of the location.

另请参阅 address ().

void QGeoLocation:: setBoundingBox (const QGeoRectangle & boundingBox )

设置 boundingBox of the location.

另请参阅 boundingBox ().

void QGeoLocation:: setCoordinate (const QGeoCoordinate & coordinate )

设置 coordinate of the location.

另请参阅 coordinate ().

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

Returns true if this location is not equal to other ,否则返回 false。

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

赋值 other to this location and returns a reference to this location.

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

Returns true if this location is equal to other ,否则返回 false。