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 <qgeoshape.h>
Public Types | |
enum | ShapeType { UnknownType , RectangleType , CircleType , PathType , PolygonType } |
Describes the type of the shape. More... | |
Public Member Functions | |
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. | |
Protected Member Functions | |
QGeoShape (QGeoShapePrivate *d) | |
Protected Attributes | |
QSharedDataPointer< QGeoShapePrivate > | d_ptr |
Properties | |
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 | |
bool | operator== (const QGeoShape &lhs, const QGeoShape &rhs) |
Returns true if the lhs geo shape is equivalent to the rhs geo shape, otherwise returns false . | |
bool | operator!= (const QGeoShape &lhs, const QGeoShape &rhs) |
Returns true if the lhs geo shape is not equivalent to the rhs geo shape, otherwise returns false . | |
QDebug | operator<< (QDebug dbg, const QGeoShape &shape) |
QDataStream & | operator<< (QDataStream &stream, const QGeoShape &shape) |
QDataStream & | operator>> (QDataStream &stream, QGeoShape &shape) |
Q_POSITIONING_EXPORT size_t | qHash (const QGeoShape &key, size_t seed=0) |
Returns the hash value for the shape, using seed for the calculation. | |
\inmodule QtPositioning
The QGeoShape class defines a geographic area.
This class is the base class for classes which specify a geographic area.
For the sake of consistency, subclasses should describe the specific details of the associated areas in terms of QGeoCoordinate instances and distances in meters.
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 16 of file qgeoshape.h.
enum QGeoShape::ShapeType |
Describes the type of the shape.
\value UnknownType A shape of unknown type \value RectangleType A rectangular shape \value CircleType A circular shape \value PathType A path type \value PolygonType A polygon type
Enumerator | |
---|---|
UnknownType | |
RectangleType | |
CircleType | |
PathType | |
PolygonType |
Definition at line 30 of file qgeoshape.h.
QGeoShape::QGeoShape | ( | ) |
Constructs a new invalid geo shape of \l UnknownType.
Definition at line 118 of file qgeoshape.cpp.
QGeoShape::QGeoShape | ( | const QGeoShape & | other | ) |
Constructs a new geo shape which is a copy of other.
Definition at line 125 of file qgeoshape.cpp.
QGeoShape::~QGeoShape | ( | ) |
Destroys this geo shape.
Definition at line 152 of file qgeoshape.cpp.
|
protected |
Definition at line 133 of file qgeoshape.cpp.
QGeoRectangle QGeoShape::boundingGeoRectangle | ( | ) | const |
Returns a QGeoRectangle representing the geographical bounding rectangle of the geo shape, that defines the latitudinal/longitudinal bounds of the geo shape.
Definition at line 217 of file qgeoshape.cpp.
QGeoCoordinate QGeoShape::center | ( | ) | const |
Returns the coordinate located at the geometric center of the geo shape.
Definition at line 232 of file qgeoshape.cpp.
bool QGeoShape::contains | ( | const QGeoCoordinate & | coordinate | ) | const |
Returns whether the coordinate coordinate is contained within this geo shape.
Definition at line 201 of file qgeoshape.cpp.
bool QGeoShape::isEmpty | ( | ) | const |
Returns whether this geo shape is empty.
An empty geo shape is a region which has a geometrical area of 0.
Definition at line 188 of file qgeoshape.cpp.
bool QGeoShape::isValid | ( | ) | const |
Returns whether this geo shape is valid.
Definition at line 173 of file qgeoshape.cpp.
Assigns other to this geo shape and returns a reference to this geo shape.
Definition at line 259 of file qgeoshape.cpp.
QString QGeoShape::toString | ( | ) | const |
Returns a string representation of this geo shape.
Definition at line 273 of file qgeoshape.cpp.
QGeoShape::ShapeType QGeoShape::type | ( | ) | const |
Returns the type of this geo shape.
Definition at line 159 of file qgeoshape.cpp.
Returns true
if the lhs geo shape is not equivalent to the rhs geo shape, otherwise returns false
.
Definition at line 50 of file qgeoshape.h.
|
friend |
Definition at line 75 of file qgeoshape.h.
Definition at line 68 of file qgeoshape.h.
Returns true
if the lhs geo shape is equivalent to the rhs geo shape, otherwise returns false
.
Definition at line 46 of file qgeoshape.h.
|
friend |
Definition at line 79 of file qgeoshape.h.
|
friend |
Returns the hash value for the shape, using seed for the calculation.
Definition at line 404 of file qgeoshape.cpp.
|
protected |
Definition at line 61 of file qgeoshape.h.
|
read |
Definition at line 22 of file qgeoshape.h.
|
read |
This property defines whether this geo shape is empty.
An empty geo shape is a region which has a geometrical area of 0.
While this property is introduced in Qt 5.5, the related accessor functions exist since the first version of this class.
Definition at line 21 of file qgeoshape.h.
|
read |
This property holds the validity of the geo shape.
A geo shape is considered to be invalid if some of the data that is required to unambiguously describe the geo shape has not been set or has been set to an unsuitable value depending on the subclass of this object. The default constructed objects of this type are invalid.
While this property is introduced in Qt 5.5, the related accessor functions exist since the first version of this class.
Definition at line 20 of file qgeoshape.h.
|
read |
This property holds the type of this geo shape.
While this property is introduced in Qt 5.5, the related accessor functions exist since the first version of this class.
Definition at line 19 of file qgeoshape.h.