Positioning 模块凭借 QML 和 C++ 接口提供位置信息。 更多...
表示 QGeoLocation 的地址 |
|
表示接近要监视区域或地区的参数 |
|
Enables the detection of proximity changes for a specified set of coordinates |
|
Defines a circular geographic area |
|
Defines a geographical position on the surface of the Earth |
|
Represents basic information about a location |
|
Defines a geographic path |
|
Defines a geographic polygon |
|
包含特定时间点的全局位置、方向和速度的有关聚合信息 |
|
Abstract base class for the distribution of positional updates |
|
Factory class used as the plugin interface for external providers of positioning data |
|
Defines a rectangular geographic area |
|
包含有关卫星的基本信息 |
|
Abstract base class for the distribution of satellite information updates |
|
Defines a geographic area |
|
Positional information using a NMEA data source |
|
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 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning)
要配置采用 qmake 构建模块,添加模块作为值为
QT
变量在工程的 .pro 文件:
QT += positioning
更多见于 Qt Positioning Overview .