Qt Positioning GeoClue v2 插件
概述
该插件是GeoClue v2库的接口。它需要在系统中安装该库才能运行。
该插件使用 D-Bus 与 GeoClue v2 D-Bus 服务建立通信,并提供定位信息。
该插件只能用于接收定位信息。它不提供卫星信息。
可使用提供者名称geoclue2 加载该插件。
参数
下表列出了可传递给 geoclue2 插件的参数。
参数 | 说明 |
---|---|
桌面 ID | D-Bus 服务使用的桌面 ID属性。如果未指定该参数,则使用QCoreApplication::applicationName() 提供的应用程序名称。 |
示例
以下示例展示了如何通过 C++ 和 QML 创建geoclue2 PositionSource 。
QML
PositionSource { name: "geoclue2" PluginParameter { name: "desktopId"; value: "SomeIdentifierString" } }
C++
QVariantMap params; params["desktopId"] = "SomeIdentifierString"; QGeoPositionInfoSource *positionSource = QGeoPositionInfoSource::createSource("geoclue2", params, this);
© 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.