本页内容

geoCircle QML Value Type

geoCircle 类型表示一个圆形的地理区域。更多内容...

Import Statement: import QtPositioning

属性

详细说明

geoCircle 类型是一种geoShape ,用于表示一个圆形的地理区域。它是QGeoCircle 的直接表示形式,通过一个coordinate 进行定义,该坐标指定了圆的center ,以及一个 qreal,用于指定圆的radius (单位为米)。

如果center 坐标无效,或者radius 小于零,则该圆被视为无效。

用法示例

要创建 geoCircle 值,请使用QtPositioning.circle() 函数:

import QtPositioning

Item {
    property geoCircle region: QtPositioning.circle(QtPositioning.coordinate(-27.5, 153.1), 1000)
}

在与 C++ 集成时,从 C++ 传递到 QML 的任何QGeoCircle 值都会自动转换为 geoCircle 值。同样,当从 QML 传递到 C++ 时,geoCircle 值会被转换为QGeoCircle 值。

属性文档

center : geoCoordinate

该属性存储geoCircle 中心点的坐标。

radius : real

该属性存储geoCircle 的半径(单位:米)。

半径的默认值为 -1,表示该geoCircle 区域无效。

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