geoShape QML Value Type
geoShape型は抽象的な地理的領域を表す。詳細...
| Import Statement: | import QtPositioning |
プロパティ
方法
- bool contains(geoCoordinate coord)
詳細な説明
この型は抽象的な地理的領域であるQGeoShape をQMLで表現したものである。すべての地理的領域に共通する属性とメソッドを含む。有効な地理的領域を表すオブジェクトを作成するには、geoRectangle またはgeoCircle を使用します。
isValid 属性は、その図形が有効な地理的領域を表すかどうかをテストするために使われます。
isEmpty 属性は、シェイプが幾何学的な面積が0の地域を表すかどうかをテストするのに使えます。
contains() メソッドは、geoCoordinate がシェイプ内にあるかどうかをテストするのに使えます。
使用例
ジオシェイプ値を作成するには、QtPositioning.shape ()関数を使用します:
C++ と統合する場合、C++ から QML に渡されたQGeoShape の値は自動的に geoShape の値に変換されることに注意。
プロパティのドキュメント
isEmpty : bool
この図形が空であるかどうかを返す。空の形状とは、幾何学的な面積が 0 の領域である。
isValid : bool
このシェイプが有効かどうかを返す。
形状を明確に記述するために必要なデータの一部が設定されていないか、不適切な値に設定されている場合、その形状は無効であるとみなされる。
type : ShapeType
シェイプの現在の型を返す。
GeoShape.UnknownType- シェイプの型は不明である。GeoShape.RectangleType- シェイプはgeoRectangle である。GeoShape.CircleType- シェイプはgeoCircle です。GeoShape.PathType- シェイプはgeoPath です (Qt 5.9 以降)。GeoShape.PolygonType- 形状はgeoPolygon です。
この QML プロパティは Qt 5.5 で導入されました。
メソッドのドキュメント
bool contains(geoCoordinate coord)
coord で指定されたcoordinate がこの形状内にある場合は 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.