Positioning 模块凭借 QML 和 C++ 接口提供位置信息。 更多...
QGeoAddress | 表示 QGeoLocation 的地址 |
QGeoAreaMonitorInfo | 表示接近要监视区域或地区的参数 |
QGeoAreaMonitorSource | Enables the detection of proximity changes for a specified set of coordinates |
QGeoCircle | Defines a circular geographic area |
QGeoCoordinate | Defines a geographical position on the surface of the Earth |
QGeoLocation | Represents basic information about a location |
QGeoPath | 定义地理路径 |
QGeoPolygon | Defines a geographic polygon |
QGeoPositionInfo | 包含特定时间点的全局位置、方向和速度的有关聚合信息 |
QGeoPositionInfoSource | Abstract base class for the distribution of positional updates |
QGeoPositionInfoSourceFactory | Factory class used as the plugin interface for external providers of positioning data |
QGeoRectangle | Defines a rectangular geographic area |
QGeoSatelliteInfo | 包含有关卫星的基本信息 |
QGeoSatelliteInfoSource | Abstract base class for the distribution of satellite information updates |
QGeoShape | Defines a geographic area |
QNmeaPositionInfoSource | Positional information using a NMEA data source |
QNmeaSatelliteInfoSource | Satellite information using an NMEA data source |
要加载 Qt Positioning 模块,添加以下语句到 .qml 文件
import QtPositioning
For C++ projects include the header appropriate for the current use case, for example applications using routes may use
#include <QGeoCoordinate>
使用 Qt 模块要求直接或透过其它依赖链接到模块库。一些构建工具为此有贡献支持,包括 CMake and qmake .
使用
find_package()
命令去定位所需模块组件,在
Qt6
包:
find_package(Qt6 COMPONENTS Positioning REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Positioning)
要配置采用 qmake 构建模块,添加模块作为值为
QT
变量在工程的 .pro 文件:
QT += positioning
更多见于 Qt Positioning 概述 .