このページでは

geoShape QML Value Type

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

Import Statement: import QtPositioning

プロパティ

方法

詳細な説明

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

isValid 属性を使用すると、その形状が有効な地理的領域を表しているかどうかを検証できます。

isEmpty 属性を使用すると、その形状が幾何学的面積が0の領域を表しているかどうかを検証できます。

contains() メソッドを使用すると、geoCoordinate がその形状の範囲内にあるかどうかを検証できます。

使用例

geoShape 値を作成するには、QtPositioning.shape() 関数を使用します。

import QtPositioning

Item {
    property geoShape region: 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 である場合。(Qt 5.10以降)

この 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.