geoShape QML Value Type

geoShape型は抽象的な地理的領域を表す。詳細...

Import Statement: import QtPositioning

プロパティ

方法

詳細な説明

この型は抽象的な地理的領域であるQGeoShape をQMLで表現したものである。すべての地理的領域に共通する属性とメソッドを含む。有効な地理的領域を表すオブジェクトを作成するには、geoRectangle またはgeoCircle を使用します。

isValid 属性は、その図形が有効な地理的領域を表すかどうかをテストするために使われます。

isEmpty 属性は、シェイプが幾何学的な面積が0の地域を表すかどうかをテストするのに使えます。

contains() メソッドは、geoCoordinate がシェイプ内にあるかどうかをテストするのに使えます。

使用例

ジオシェイプ値を作成するには、QtPositioning.shape ()関数を使用します:

import QtPositioning

Item {
    property geoShape region: QtPositioning.shape()
}

C++ と統合する場合、C++ から QML に渡されたQGeoShape の値は自動的に geoShape の値に変換されることに注意。

プロパティの説明

isEmpty : bool

この shape が空であるかどうかを返す。空の形状とは、幾何学的な面積が 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 がこの shape 内にある場合は true を返し、そうでない場合は false を返します。


© 2025 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.