QGeoShape Class▲
-
Header: QGeoShape
-
Since: Qt 5.2
-
qmake: QT += positioning
-
Inherited By: QGeoCircle, QGeoPath, QGeoPolygon, and QGeoRectangle
-
Group: QGeoShape is part of QtPositioning-positioning
Detailed Description▲
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 Q_GADGET since Qt 5.5. It can be directly used from C++ and QML.
Member Type Documentation▲
enum QGeoShape::ShapeType▲
Property Documentation▲
[read-only, since 5.5] isEmpty : const bool▲
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.
This property was introduced in Qt 5.5.
Access functions:
-
bool isEmpty() const
[read-only, since 5.5] isValid : const bool▲
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.
This property was introduced in Qt 5.5.
Access functions:
-
bool isValid() const
[read-only, since 5.5] type : const ShapeType▲
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.
This property was introduced in Qt 5.5.
Access functions:
-
type() const
Member Function Documentation▲
QGeoShape::QGeoShape()▲
Constructs a new invalid geo shape of UnknownType.
QGeoShape::QGeoShape(const QGeoShape &other)▲
Constructs a new geo shape which is a copy of other.
QGeoShape::~QGeoShape()▲
Destroys this geo shape.
[since 5.9] 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.
This function was introduced in Qt 5.9.
[since 5.5] QGeoCoordinate QGeoShape::center() const▲
Returns the coordinate located at the geometric center of the geo shape.
This function was introduced in Qt 5.5.
bool QGeoShape::contains(const QGeoCoordinate &coordinate) const▲
Returns whether the coordinate coordinate is contained within this geo shape.
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.
Getter function for property isEmpty.
bool QGeoShape::isValid() const▲
Returns whether this geo shape is valid.
Getter function for property isValid.
[since 5.5] QString QGeoShape::toString() const▲
Returns a string representation of this geo shape.
This function was introduced in Qt 5.5.
QGeoShape::ShapeType QGeoShape::type() const▲
Returns the type of this geo shape.
Getter function for property type.
bool QGeoShape::operator!=(const QGeoShape &other) const▲
Returns true if the other geo shape is not equivalent to this geo shape, otherwise returns false.
QGeoShape &QGeoShape::operator=(const QGeoShape &other)▲
Assigns other to this geo shape and returns a reference to this geo shape.
bool QGeoShape::operator==(const QGeoShape &other) const▲
Returns true if the other geo shape is equivalent to this geo shape, otherwise returns false.
Obsolete Members for QGeoShape▲
The following members of class QGeoShape are deprecated. We strongly advise against using them in new code.
Obsolete Member Function Documentation▲
void QGeoShape::extendShape(const QGeoCoordinate &coordinate)▲
This function is deprecated. We strongly advise against using it in new code.
This method used to extend the geo shape to also cover the coordinate coordinate.
It currently only works for QGeoCircle and QGeoRectangle, on which the functionality remains, now also accessible through QGeoCircle::extendCircle and QGeoRectangle::extendRectangle.
This method should therefore not be called on a generic QGeoShape any longer, as the behavior for other shape types is undefined.