QGeoCircle Class

The QGeoCircle class defines a circular geographic area. 更多...

頭: #include <QGeoCircle>
qmake: QT += positioning
Since: Qt 5.2
繼承: QGeoShape

特性

公共函數

QGeoCircle ()
QGeoCircle (const QGeoCoordinate & center , qreal radius = -1.0)
QGeoCircle (const QGeoCircle & other )
QGeoCircle (const QGeoShape & other )
~QGeoCircle ()
QGeoCoordinate center () const
void extendCircle (const QGeoCoordinate & coordinate )
qreal radius () const
void setCenter (const QGeoCoordinate & center )
void setRadius (qreal radius )
QString toString () const
void translate (double degreesLatitude , double degreesLongitude )
QGeoCircle translated (double degreesLatitude , double degreesLongitude ) const
bool operator!= (const QGeoCircle & other ) const
QGeoCircle & operator= (const QGeoCircle & other )
bool operator== (const QGeoCircle & other ) const

靜態公共成員

const QMetaObject staticMetaObject

詳細描述

The QGeoCircle class defines a circular geographic area.

The circle is defined in terms of a QGeoCoordinate which specifies the center of the circle and a qreal which specifies the radius of the circle in meters.

The circle is considered invalid if the center coordinate is invalid or if the radius is less than zero.

This class is a Q_GADGET since Qt 5.5. It can be directly used from C++ and QML .

特性文檔編製

center : QGeoCoordinate

This property holds the center coordinate for the geo circle.

The circle is considered invalid if this property contains an invalid coordinate.

A default constructed QGeoCircle uses an invalid QGeoCoordinate as center.

While this property is introduced in Qt 5.5, the related accessor functions exist since the first version of this class.

該特性在 Qt 5.5 引入。

訪問函數:

QGeoCoordinate center () const
void setCenter (const QGeoCoordinate & center )

radius : qreal

This property holds the circle radius in meters.

The circle is considered invalid if this property is negative.

By default, the radius is initialized with -1 .

While this property is introduced in Qt 5.5, the related accessor functions exist since the first version of this class.

該特性在 Qt 5.5 引入。

訪問函數:

qreal radius () const
void setRadius (qreal radius )

成員函數文檔編製

QGeoCircle:: QGeoCircle ()

Constructs a new, invalid geo circle.

QGeoCircle:: QGeoCircle (const QGeoCoordinate & center , qreal radius = -1.0)

Constructs a new geo circle centered at center and with a radius of radius meters.

QGeoCircle:: QGeoCircle (const QGeoCircle & other )

Constructs a new geo circle from the contents of other .

QGeoCircle:: QGeoCircle (const QGeoShape & other )

Constructs a new geo circle from the contents of other .

QGeoCircle:: ~QGeoCircle ()

Destroys this geo circle.

QGeoCoordinate QGeoCircle:: center () const

Returns the center coordinate of this geo circle. Equivalent to QGeoShape::center ().

注意: getter 函數對於特性 center .

另請參閱 setCenter ().

void QGeoCircle:: extendCircle (const QGeoCoordinate & coordinate )

Extends the geo circle to also cover the coordinate coordinate

該函數在 Qt 5.9 引入。

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

qreal QGeoCircle:: radius () const

Returns the radius in meters of this geo circle.

注意: getter 函數對於特性 radius .

另請參閱 setRadius ().

void QGeoCircle:: setCenter (const QGeoCoordinate & center )

Sets the center coordinate of this geo circle to center .

注意: setter 函數對於特性 center .

另請參閱 center ().

void QGeoCircle:: setRadius ( qreal radius )

Sets the radius in meters of this geo circle to radius .

注意: setter 函數對於特性 radius .

另請參閱 radius ().

QString QGeoCircle:: toString () const

Returns the geo circle properties as a string.

該函數在 Qt 5.5 引入。

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

void QGeoCircle:: translate ( double degreesLatitude , double degreesLongitude )

Translates this geo circle by degreesLatitude northwards and degreesLongitude eastwards.

Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

QGeoCircle QGeoCircle:: translated ( double degreesLatitude , double degreesLongitude ) const

Returns a copy of this geo circle translated by degreesLatitude northwards and degreesLongitude eastwards.

Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

另請參閱 translate ().

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

Returns whether this geo circle is not equal to other .

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

賦值 other to this geo circle and returns a reference to this geo circle.

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

Returns whether this geo circle is equal to other .