このページでは

QGeoShape Class

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)

詳細な説明

このクラスは、地理的領域を指定するクラスの基底クラスです。

一貫性を保つため、サブクラスは、関連するエリアの具体的な詳細を、QGeoCoordinate のインスタンスおよびメートル単位の距離を用いて記述する必要があります。

このクラスは、QML でも `geoShape` として利用できます。

メンバ型のドキュメント

enum QGeoShape::ShapeType

図形のタイプを記述します。

定数値説明
QGeoShape::UnknownType0型が不明な図形
QGeoShape::RectangleType1長方形の図形
QGeoShape::CircleType2円形の図形
QGeoShape::PathType3パス型
QGeoShape::PolygonType4多角形タイプ

プロパティのドキュメント

[read-only] center : QGeoCoordinate

このプロパティは、図形の幾何学的中心の座標を保持します。

アクセス関数:

QGeoCoordinate center() const

[read-only] isEmpty : bool

このプロパティは、このジオシェイプが空であるかどうかを定義します。

空のジオシェイプとは、幾何学的面積が 0 の領域のことです。

このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。

アクセス関数:

bool isEmpty() const

[read-only] isValid : bool

このプロパティは、ジオシェイプの有効性を保持します。

ジオシェイプを明確に記述するために必要なデータの一部が設定されていない場合、またはこのオブジェクトのサブクラスに応じて不適切な値が設定されている場合、そのジオシェイプは無効とみなされます。この型のデフォルトコンストラクタで生成されたオブジェクトは無効です。

このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。

アクセス関数:

bool isValid() const

[read-only] type : ShapeType

このプロパティは、このジオシェイプの型を保持します。

このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。

アクセス関数:

QGeoShape::ShapeType type() const

メンバ関数のドキュメント

QGeoShape::QGeoShape()

UnknownType の新しい無効なジオシェイプを作成します。

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

other のコピーである新しいジオシェイプを生成します。

注:この関数は 、メタオブジェクトシステムを介して、またはQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[noexcept] QGeoShape::~QGeoShape()

このジオシェイプを削除します。

[invokable] QGeoRectangle QGeoShape::boundingGeoRectangle() const

geoシェイプの地理的な境界矩形を表すQGeoRectangle を返します。この矩形は、geoシェイプの緯度・経度の境界を定義します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

QGeoCoordinate QGeoShape::center() const

ジオシェイプの幾何学的中心に位置する座標を返します。

注: プロパティ「center」のゲッター 関数です。

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

座標 `coordinate ` がこのジオシェイプ内に含まれているかどうかを返します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

bool QGeoShape::isEmpty() const

このジオシェイプが空であるかどうかを返します。

空のジオシェイプとは、幾何学的面積が 0 の領域のことです。

注: プロパティ `isEmpty`のゲッター関数です 。

bool QGeoShape::isValid() const

このジオシェイプが有効かどうかを返します。

注: isValid プロパティのゲッター 関数です。

[invokable] QString QGeoShape::toString() const

このジオシェイプを表す文字列を返します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

QGeoShape::ShapeType QGeoShape::type() const

このジオシェイプの型を返します。

注: プロパティ typeのゲッター 関数です。

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

このジオシェイプにother を割り当て、このジオシェイプへの参照を返します。

関連する非メンバー

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

shape のハッシュ値を、seed を用いて計算し、その結果を返します。

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

lhs のジオシェイプがrhs のジオシェイプと等しくない場合はtrue を返し、そうでない場合はfalse を返します。

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

lhs のジオシェイプがrhs のジオシェイプと等価である場合はtrue を返し、そうでない場合はfalse を返します。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.