The QGeoShape class defines a geographic area. 更多...
头: | #include <QGeoShape> |
qmake: | QT += positioning |
Since: | Qt 5.2 |
继承者: | QGeoCircle , QGeoPath ,和 QGeoRectangle |
enum | ShapeType { UnknownType, RectangleType, CircleType, PathType } |
QGeoShape () | |
QGeoShape (const QGeoShape & other ) | |
~QGeoShape () | |
QGeoRectangle | boundingGeoRectangle () const |
QGeoCoordinate | center () const |
bool | contains (const QGeoCoordinate & coordinate ) const |
bool | isEmpty () const |
bool | isValid () const |
QString | toString () const |
ShapeType | type () const |
bool | operator!= (const QGeoShape & other ) const |
QGeoShape & | operator= (const QGeoShape & other ) |
bool | operator== (const QGeoShape & other ) const |
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 Q_GADGET since Qt 5.5. It can be directly used from C++ and QML .
Describes the type of the shape.
常量 | 值 | 描述 |
---|---|---|
QGeoShape::UnknownType
|
0
|
A shape of unknown type. |
QGeoShape::RectangleType
|
1
|
A rectangular shape. |
QGeoShape::CircleType
|
2
|
A circular shape. |
QGeoShape::PathType
|
3
|
A path type. |
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.
该特性在 Qt 5.5 引入。
访问函数:
bool | isEmpty () const |
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.
该特性在 Qt 5.5 引入。
访问函数:
bool | isValid () const |
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.
该特性在 Qt 5.5 引入。
访问函数:
ShapeType | type () const |
Constructs a new invalid geo shape of UnknownType .
Constructs a new geo shape which is a copy of other .
Destroys this geo shape.
返回 QGeoRectangle representing the geographical bounding rectangle of the geo shape, that defines the latitudinal/longitudinal bounds of the geo shape.
该函数在 Qt 5.9 引入。
Returns the coordinate located at the geometric center of the geo shape.
该函数在 Qt 5.5 引入。
Returns whether the coordinate coordinate is contained within this geo shape.
Returns whether this geo shape is empty.
An empty geo shape is a region which has a geometrical area of 0.
注意: Getter 函数对于特性 isEmpty .
Returns whether this geo shape is valid.
注意: Getter 函数对于特性 isValid .
Returns a string representation of this geo shape.
该函数在 Qt 5.5 引入。
Returns the type of this geo shape.
注意: Getter 函数对于特性 type .
返回 true 若 other geo shape is not equivalent to this geo shape, otherwise returns false.
赋值 other to this geo shape and returns a reference to this geo shape.
返回 true 若 other geo shape is equivalent to this geo shape, otherwise returns false.