QGeoCircle Class▲
-
Header: QGeoCircle
-
Since: Qt 5.2
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
-
qmake: QT += positioning
-
Inherits: QGeoShape
-
Group: QGeoCircle is part of QtPositioning-positioning
Detailed Description▲
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.
Property Documentation▲
[since 5.5] 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.
This property was introduced in Qt 5.5.
Access functions:
[since 5.5] 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.
This property was introduced in Qt 5.5.
Access functions:
Member Function Documentation▲
QGeoCircle::QGeoCircle()▲
Constructs a new, invalid geo circle.
QGeoCircle::QGeoCircle(const QGeoCoordinate ¢er, qreal radius = -1.0)▲
Constructs a new geo circle centered at center and with a radius of radius meters.
QGeoCircle::QGeoCircle(const QGeoShape &other)▲
Constructs a new geo circle from the contents of other.
QGeoCircle::QGeoCircle(const QGeoCircle &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 function for property center.
See Also▲
See also setCenter()
[since 5.9] void QGeoCircle::extendCircle(const QGeoCoordinate &coordinate)▲
Extends the geo circle to also cover the coordinate coordinate
This function was introduced in Qt 5.9.
qreal QGeoCircle::radius() const▲
Returns the radius in meters of this geo circle.
Getter function for property radius.
See Also▲
See also setRadius()
void QGeoCircle::setCenter(const QGeoCoordinate ¢er)▲
Sets the center coordinate of this geo circle to center.
Setter function for property center.
See Also▲
See also center()
void QGeoCircle::setRadius(qreal radius)▲
Sets the radius in meters of this geo circle to radius.
Setter function for property radius.
See Also▲
See also radius()
[since 5.5] QString QGeoCircle::toString() const▲
Returns the geo circle properties as a string.
This function was introduced in Qt 5.5.
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.
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.
See Also▲
See also translate()
QGeoCircle &QGeoCircle::operator=(const QGeoCircle &other)▲
Assigns other to this geo circle and returns a reference to this geo circle.