QGeoShape 類

QGeoShape 類定義地理區域。 更多...

頭: #include <QGeoShape>
CMake: find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
qmake: QT += positioning
繼承者:

QGeoCircle , QGeoPath , QGeoPolygon ,和 QGeoRectangle

公共類型

enum ShapeType { UnknownType, RectangleType, CircleType, PathType, PolygonType }

特性

公共函數

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
QGeoShape::ShapeType type () const
QGeoShape & operator= (const QGeoShape & other )
size_t qHash (const QGeoShape & shape , size_t seed = 0)
bool operator!= (const QGeoShape & lhs , const QGeoShape & rhs )
bool operator== (const QGeoShape & lhs , const QGeoShape & rhs )

詳細描述

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 .

成員類型文檔編製

enum QGeoShape:: ShapeType

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
QGeoShape::PolygonType 4 A polygon type

特性文檔編製

[read-only] center : const QGeoCoordinate

This property holds the coordinate at the geometric center of the shape.

訪問函數:

QGeoCoordinate center () const

[read-only] 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.

訪問函數:

bool isEmpty () const

[read-only] 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.

訪問函數:

bool isValid () const

[read-only] 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.

訪問函數:

QGeoShape::ShapeType type () const

成員函數文檔編製

QGeoShape:: QGeoShape ()

Constructs a new invalid geo shape of UnknownType .

[invokable] QGeoShape:: QGeoShape (const QGeoShape & other )

Constructs a new geo shape which is a copy of other .

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

[noexcept] QGeoShape:: ~QGeoShape ()

Destroys this geo shape.

[invokable] QGeoRectangle QGeoShape:: boundingGeoRectangle () const

返迴 QGeoRectangle representing the geographical bounding rectangle of the geo shape, that defines the latitudinal/longitudinal bounds of the geo shape.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

QGeoCoordinate QGeoShape:: center () const

Returns the coordinate located at the geometric center of the geo shape.

注意: Getter function for property center.

[invokable] bool QGeoShape:: contains (const QGeoCoordinate & coordinate ) const

Returns whether the coordinate coordinate is contained within this geo shape.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

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.

[invokable] QString QGeoShape:: toString () const

Returns a string representation of this geo shape.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

QGeoShape::ShapeType QGeoShape:: type () const

Returns the type of this geo shape.

注意: getter 函數對於特性 type。

QGeoShape &QGeoShape:: operator= (const QGeoShape & other )

賦值 other to this geo shape and returns a reference to this geo shape.

相關非成員

[noexcept] size_t qHash (const QGeoShape & shape , size_t seed = 0)

返迴哈希值為 shape ,使用 seed for the calculation.

bool operator!= (const QGeoShape & lhs , const QGeoShape & rhs )

返迴 truelhs geo shape is not equivalent to the rhs geo shape, otherwise returns false .

bool operator== (const QGeoShape & lhs , const QGeoShape & rhs )

返迴 truelhs geo shape is equivalent to the rhs geo shape, otherwise returns false .