Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QGeoCircle Class Reference

\inmodule QtPositioning More...

#include <qgeocircle.h>

+ Inheritance diagram for QGeoCircle:
+ Collaboration diagram for QGeoCircle:

Public Member Functions

 QGeoCircle ()
 Constructs a new, invalid geo circle.
 
 QGeoCircle (const QGeoCoordinate &center, 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.
 
QGeoCircleoperator= (const QGeoCircle &other)
 Assigns other to this geo circle and returns a reference to this geo circle.
 
void setCenter (const QGeoCoordinate &center)
 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.
 
- Public Member Functions inherited from QGeoShape
 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.
 
QGeoShapeoperator= (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.
 
- Properties inherited from QGeoShape
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

QDataStreamoperator<< (QDataStream &stream, const QGeoCircle &circle)
 
QDataStreamoperator>> (QDataStream &stream, QGeoCircle &circle)
 

Additional Inherited Members

- Public Types inherited from QGeoShape
enum  ShapeType {
  UnknownType , RectangleType , CircleType , PathType ,
  PolygonType
}
 Describes the type of the shape. More...
 
- Protected Member Functions inherited from QGeoShape
 QGeoShape (QGeoShapePrivate *d)
 
- Protected Attributes inherited from QGeoShape
QSharedDataPointer< QGeoShapePrivated_ptr
 

Detailed Description

\inmodule QtPositioning

Since
5.2

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.

Constructor & Destructor Documentation

◆ QGeoCircle() [1/4]

QGeoCircle::QGeoCircle ( )

Constructs a new, invalid geo circle.

Definition at line 80 of file qgeocircle.cpp.

◆ QGeoCircle() [2/4]

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.

References center, QGeoShape::d_ptr, and radius.

◆ QGeoCircle() [3/4]

QGeoCircle::QGeoCircle ( const QGeoCircle & other)

Constructs a new geo circle from the contents of other.

Definition at line 96 of file qgeocircle.cpp.

◆ QGeoCircle() [4/4]

QGeoCircle::QGeoCircle ( const QGeoShape & other)

Constructs a new geo circle from the contents of other.

Definition at line 104 of file qgeocircle.cpp.

References QGeoShape::CircleType, QGeoShape::d_ptr, and QGeoShape::type.

◆ ~QGeoCircle()

QGeoCircle::~QGeoCircle ( )

Destroys this geo circle.

Definition at line 114 of file qgeocircle.cpp.

Member Function Documentation

◆ center()

QGeoCoordinate QGeoCircle::center ( ) const

Returns the center coordinate of this geo circle.

Equivalent to QGeoShape::center().

Definition at line 148 of file qgeocircle.cpp.

References d.

◆ extendCircle()

void QGeoCircle::extendCircle ( const QGeoCoordinate & coordinate)

Extends the geo circle to also cover the coordinate coordinate.

Since
5.9

Definition at line 361 of file qgeocircle.cpp.

References d.

◆ operator=()

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.

References QGeoShape::operator=(), and other().

+ Here is the call graph for this function:

◆ radius()

qreal QGeoCircle::radius ( ) const

Returns the radius in meters of this geo circle.

Definition at line 168 of file qgeocircle.cpp.

References d.

◆ setCenter()

void QGeoCircle::setCenter ( const QGeoCoordinate & center)

Sets the center coordinate of this geo circle to center.

Definition at line 138 of file qgeocircle.cpp.

References center, and d.

Referenced by importMultiPoint(), and QDeclarativeCircleMapItem::setCenter().

+ Here is the caller graph for this function:

◆ setRadius()

void QGeoCircle::setRadius ( qreal radius)

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

Definition at line 158 of file qgeocircle.cpp.

References d, and radius.

Referenced by QDeclarativeCircleMapItem::setRadius().

+ Here is the caller graph for this function:

◆ toString()

QString QGeoCircle::toString ( ) const

Returns the geo circle properties as a string.

Since
5.5

Definition at line 373 of file qgeocircle.cpp.

References center, QGeoShape::CircleType, QStringLiteral, qWarning, radius, and QGeoShape::type.

◆ translate()

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.

References d, and QLocationUtils::wrapLong().

+ Here is the call graph for this function:

◆ translated()

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
translate()

Definition at line 349 of file qgeocircle.cpp.

Friends And Related Symbol Documentation

◆ operator<<

QDataStream & operator<< ( QDataStream & stream,
const QGeoCircle & circle )
friend

Definition at line 47 of file qgeocircle.h.

◆ operator>>

QDataStream & operator>> ( QDataStream & stream,
QGeoCircle & circle )
friend

Definition at line 51 of file qgeocircle.h.

Property Documentation

◆ center

QGeoCircle::center
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.

Since
5.5

Definition at line 17 of file qgeocircle.h.

Referenced by QGeoCircle(), calculatePeripheralPoints(), exportPoint(), QGeoJson::operator<<(), QDeclarativeCircleMapItem::setCenter(), setCenter(), QDeclarativeCircleMapItem::setGeoShape(), toString(), and QDeclarativeCircleMapItemPrivateCPU::updatePolish().

◆ radius

QGeoCircle::radius
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.

Since
5.5

Definition at line 18 of file qgeocircle.h.

Referenced by QGeoCircle(), calculatePeripheralPoints(), QGeoJson::operator<<(), QDeclarativeCircleMapItem::radius(), QDeclarativeCircleMapItem::setGeoShape(), QDeclarativeCircleMapItem::setRadius(), setRadius(), toString(), and QDeclarativeCircleMapItemPrivateCPU::updatePolish().


The documentation for this class was generated from the following files: