geocircle QML Value Type

地理圆类型表示一个圆形地理区域。更多

Import Statement: import QtPositioning

详细说明

geocircle 类型是表示圆形地理区域的geoshape 。它是QGeoCircle 的直接表示形式,由coordinate (指定圆的center )和 qreal(指定圆的radius ,单位为米)定义。

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

使用示例

使用var 类型的属性存储geocircle 。要创建geocircle 值,请使用QtPositioning.circle() 函数:

import QtPositioning

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

与 C++ 整合时,请注意任何从 C++ 传入 QML 的QGeoCircle 值都会自动转换为geocircle 值,反之亦然。

属性

中心

coordinate radius

此属性保存地理圆中心的坐标。

半径

real radius

该属性保存地理圆的半径(以米为单位)。

半径的默认值为-1,表示地理圆区域无效。

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