![]() |
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 <qgeocircle.h>
Public Member Functions | |
QGeoCircle () | |
Constructs a new, invalid geo circle. | |
QGeoCircle (const QGeoCoordinate ¢er, qreal radius=-1.0) | |
Constructs a new geo circle centered at center and with a radius of radius meters. | |
QGeoCircle (const QGeoCircle &other) | |
Constructs a new geo circle from the contents of other. | |
QGeoCircle (const QGeoShape &other) | |
Constructs a new geo circle from the contents of other. | |
~QGeoCircle () | |
Destroys this geo circle. | |
QGeoCircle & | operator= (const QGeoCircle &other) |
Assigns other to this geo circle and returns a reference to this geo circle. | |
void | setCenter (const QGeoCoordinate ¢er) |
Sets the center coordinate of this geo circle to center. | |
QGeoCoordinate | center () const |
Returns the center coordinate of this geo circle. | |
void | setRadius (qreal radius) |
Sets the radius in meters of this geo circle to radius. | |
qreal | radius () const |
Returns the radius in meters of this geo circle. | |
Q_INVOKABLE void | translate (double degreesLatitude, double degreesLongitude) |
Translates this geo circle by degreesLatitude northwards and degreesLongitude eastwards. | |
Q_INVOKABLE QGeoCircle | translated (double degreesLatitude, double degreesLongitude) const |
Returns a copy of this geo circle translated by degreesLatitude northwards and degreesLongitude eastwards. | |
Q_INVOKABLE void | extendCircle (const QGeoCoordinate &coordinate) |
Extends the geo circle to also cover the coordinate coordinate. | |
Q_INVOKABLE QString | toString () const |
Returns the geo circle properties as a string. | |
![]() | |
QGeoShape () | |
Constructs a new invalid geo shape of \l UnknownType. | |
Q_INVOKABLE | QGeoShape (const QGeoShape &other) |
Constructs a new geo shape which is a copy of other. | |
~QGeoShape () | |
Destroys this geo shape. | |
ShapeType | type () const |
Returns the type of this geo shape. | |
bool | isValid () const |
Returns whether this geo shape is valid. | |
bool | isEmpty () const |
Returns whether this geo shape is empty. | |
Q_INVOKABLE bool | contains (const QGeoCoordinate &coordinate) const |
Returns whether the coordinate coordinate is contained within this geo shape. | |
Q_INVOKABLE QGeoRectangle | boundingGeoRectangle () const |
Returns a QGeoRectangle representing the geographical bounding rectangle of the geo shape, that defines the latitudinal/longitudinal bounds of the geo shape. | |
QGeoCoordinate | center () const |
Returns the coordinate located at the geometric center of the geo shape. | |
QGeoShape & | operator= (const QGeoShape &other) |
Assigns other to this geo shape and returns a reference to this geo shape. | |
Q_INVOKABLE QString | toString () const |
Returns a string representation of this geo shape. | |
Properties | |
QGeoCoordinate | center |
This property holds the center coordinate for the geo circle. | |
qreal | radius |
This property holds the circle radius in meters. | |
![]() | |
ShapeType | type |
This property holds the type of this geo shape. | |
bool | isValid |
This property holds the validity of the geo shape. | |
bool | isEmpty |
This property defines whether this geo shape is empty. | |
QGeoCoordinate | center |
Friends | |
QDataStream & | operator<< (QDataStream &stream, const QGeoCircle &circle) |
QDataStream & | operator>> (QDataStream &stream, QGeoCircle &circle) |
Additional Inherited Members | |
![]() | |
enum | ShapeType { UnknownType , RectangleType , CircleType , PathType , PolygonType } |
Describes the type of the shape. More... | |
![]() | |
QGeoShape (QGeoShapePrivate *d) | |
![]() | |
QSharedDataPointer< QGeoShapePrivate > | d_ptr |
\inmodule QtPositioning
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 \l Q_GADGET since Qt 5.5. It can be \l{Cpp_value_integration_positioning}{directly used from C++ and QML}.
Definition at line 14 of file qgeocircle.h.
QGeoCircle::QGeoCircle | ( | ) |
Constructs a new, invalid geo circle.
Definition at line 80 of file qgeocircle.cpp.
QGeoCircle::QGeoCircle | ( | const QGeoCoordinate & | center, |
qreal | radius = -1.0 ) |
Constructs a new geo circle centered at center and with a radius of radius meters.
Definition at line 88 of file qgeocircle.cpp.
QGeoCircle::QGeoCircle | ( | const QGeoCircle & | other | ) |
Constructs a new geo circle from the contents of other.
Definition at line 96 of file qgeocircle.cpp.
QGeoCircle::QGeoCircle | ( | const QGeoShape & | other | ) |
Constructs a new geo circle from the contents of other.
Definition at line 104 of file qgeocircle.cpp.
QGeoCircle::~QGeoCircle | ( | ) |
Destroys this geo circle.
Definition at line 114 of file qgeocircle.cpp.
QGeoCoordinate QGeoCircle::center | ( | ) | const |
Returns the center coordinate of this geo circle.
Equivalent to QGeoShape::center().
Definition at line 148 of file qgeocircle.cpp.
void QGeoCircle::extendCircle | ( | const QGeoCoordinate & | coordinate | ) |
Extends the geo circle to also cover the coordinate coordinate.
Definition at line 361 of file qgeocircle.cpp.
QGeoCircle & QGeoCircle::operator= | ( | const QGeoCircle & | other | ) |
Assigns other to this geo circle and returns a reference to this geo circle.
Definition at line 119 of file qgeocircle.cpp.
qreal QGeoCircle::radius | ( | ) | const |
Returns the radius in meters of this geo circle.
Definition at line 168 of file qgeocircle.cpp.
void QGeoCircle::setCenter | ( | const QGeoCoordinate & | center | ) |
Sets the center coordinate of this geo circle to center.
Definition at line 138 of file qgeocircle.cpp.
Sets the radius in meters of this geo circle to radius.
Definition at line 158 of file qgeocircle.cpp.
QString QGeoCircle::toString | ( | ) | const |
Returns the geo circle properties as a string.
Definition at line 373 of file qgeocircle.cpp.
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.
Definition at line 307 of file qgeocircle.cpp.
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.
Definition at line 349 of file qgeocircle.cpp.
|
friend |
Definition at line 47 of file qgeocircle.h.
|
friend |
Definition at line 51 of file qgeocircle.h.
|
readwrite |
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 \l QGeoCoordinate as center.
While this property is introduced in Qt 5.5, the related accessor functions exist since the first version of this class.
Definition at line 17 of file qgeocircle.h.
|
readwrite |
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.
Definition at line 18 of file qgeocircle.h.