QGeoManeuver Class
QGeoManeuver 类表示两个 QGeoRouteSegment 相交点的相关信息。更多
Header: | #include <QGeoManeuver> |
qmake: | QT += location |
公共类型
enum | InstructionDirection { NoDirection, DirectionForward, DirectionBearRight, DirectionLightRight, DirectionRight, …, DirectionBearLeft } |
属性
|
|
公共职能
QGeoManeuver() | |
QGeoManeuver(const QGeoManeuver &other) | |
~QGeoManeuver() | |
QGeoManeuver::InstructionDirection | direction() const |
qreal | distanceToNextInstruction() const |
QVariantMap | extendedAttributes() const |
QString | instructionText() const |
bool | isValid() const |
QGeoCoordinate | position() const |
int | timeToNextInstruction() const |
QGeoCoordinate | waypoint() const |
QGeoManeuver & | operator=(const QGeoManeuver &other) |
相关非成员
bool | operator!=(const QGeoManeuver &lhs, const QGeoManeuver &rhs) |
bool | operator==(const QGeoManeuver &lhs, const QGeoManeuver &rhs) |
详细说明
QGeoRouteSegment QGeoManeuver 实例可以看作是路由图上的边,而 QGeoManeuver 实例则是附在路由图顶点上的可选标签。
QGeoManeuver 实例中最有趣的信息通常是要提供的文字导航和提供导航的位置,可分别通过instructionText() 和position() 访问。
还可以通过检查waypoint() 是否返回有效的QGeoCoordinate 来确定路由航点是否已通过。
成员类型文档
enum QGeoManeuver::InstructionDirection
描述与 QGeoManaeuver 相关的指令文本的方向变化。
常量 | 值 | 说明 |
---|---|---|
QGeoManeuver::NoDirection | 0 | 指令文本没有关联方向。 |
QGeoManeuver::DirectionForward | 1 | 该指令表示行进方向无需改变。 |
QGeoManeuver::DirectionBearRight | 2 | 该指令表示行驶方向应向右。 |
QGeoManeuver::DirectionLightRight | 3 | 该指令表示需要向右转弯。 |
QGeoManeuver::DirectionRight | 4 | 该指令表示需要向右转弯。 |
QGeoManeuver::DirectionHardRight | 5 | 该指令表示需要向右转弯。 |
QGeoManeuver::DirectionUTurnRight | 6 | 该指令表示需要向右转弯。 |
QGeoManeuver::DirectionUTurnLeft | 7 | 该指令表示需要向左转弯。 |
QGeoManeuver::DirectionHardLeft | 8 | 该指令表示需要向左转弯。 |
QGeoManeuver::DirectionLeft | 9 | 该指令表示需要向左转弯。 |
QGeoManeuver::DirectionLightLeft | 10 | 该指令表示需要向左转弯。 |
QGeoManeuver::DirectionBearLeft | 11 | 指示表示行驶方向应向左。 |
属性文件
[read-only]
direction : const InstructionDirection
该属性保存与相关指令有关的方向。
访问功能:
QGeoManeuver::InstructionDirection | direction() const |
[read-only]
distanceToNextInstruction : const qreal
该属性表示发出该指令的点与下一条指令应发出的点之间的距离(以米为单位)。
访问功能:
qreal | distanceToNextInstruction() const |
[read-only, since QtLocation 5.11]
extendedAttributes : const QVariantMap
此属性包含与此操作相关的扩展属性。
此属性在 QtLocation 5.11 中引入。
访问函数:
QVariantMap | extendedAttributes() const |
[read-only]
instructionText : const QString
该属性包含文本导航说明。
访问功能:
QString | instructionText() const |
[read-only]
position : const QGeoCoordinate
该属性用于保存instructionText 应显示的位置。
访问功能:
QGeoCoordinate | position() const |
[read-only]
timeToNextInstruction : const int
该属性保存从发出相关指令的时间点到发出下一条指令的时间点所需的估计时间(以秒为单位)。
访问功能:
int | timeToNextInstruction() const |
[read-only]
valid : const bool
该属性表示该操作是否有效。
当没有信息需要附加到QGeoRouteSegment 实例的端点时,就会使用无效操作。
访问功能:
bool | isValid() const |
[read-only]
waypoint : const QGeoCoordinate
该属性包含与该操作相关的航点。
如果没有与该机动相关联的航点,则该属性中的QGeoCoordinate 无效。
访问函数:
QGeoCoordinate | waypoint() const |
成员函数文档
QGeoManeuver::QGeoManeuver()
构造一个无效的操纵对象。
在调用 setPosition()、setInstructionText()、setDirection()、setTimeToNextInstruction()、setDistanceToNextInstruction() 或 setWaypoint() 中的一个之前,该操纵将一直处于无效状态。
[noexcept]
QGeoManeuver::QGeoManeuver(const QGeoManeuver &other)
用other 中的内容构造一个机动对象。
[noexcept]
QGeoManeuver::~QGeoManeuver()
摧毁该操纵对象。
QGeoManeuver &QGeoManeuver::operator=(const QGeoManeuver &other)
将other 分配给该机动对象,然后返回对该机动对象的引用。
相关非成员
[noexcept]
bool operator!=(const QGeoManeuver &lhs, const QGeoManeuver &rhs)
返回lhs 操纵是否不等于rhs 。
[noexcept]
bool operator==(const QGeoManeuver &lhs, const QGeoManeuver &rhs)
返回lhs 机动是否等于rhs 。
© 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.