PySide6.QtLocation.QGeoManeuver

class QGeoManeuver

QGeoManeuver 类表示与两个 QGeoRouteSegments 相遇点相关的信息。更多

概要

属性

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

QGeoRouteSegment 实例可以被视为路由图中的边,而 QGeoManeuver 实例则是附加在图的顶点上的可选标签。

QGeoManeuver实例中,最有趣的信息通常是提供的文本导航和提供它的位置,分别可以通过instructionText()position()访问。

也可以通过检查waypoint()是否返回有效的QGeoCoordinate来确定是否已经通过了一个路由航点。

class InstructionDirection

描述与QGeoManaeuver相关的指令文本所关联的方向变化。

常量

描述

QGeoManeuver.NoDirection

没有与指令文本相关的方向。

QGeoManeuver.DirectionForward

该指令表示行驶方向不需要改变。

QGeoManeuver.DirectionBearRight

该指令表示行驶方向应向右偏转。

QGeoManeuver.DirectionLightRight

指示需要向右轻转。

QGeoManeuver.DirectionRight

指示需要向右转。

QGeoManeuver.DirectionHardRight

指示需要向右急转。

QGeoManeuver.DirectionUTurnRight

该指令表示需要向右进行掉头。

QGeoManeuver.DirectionUTurnLeft

该指令表示需要向左掉头。

QGeoManeuver.DirectionHardLeft

指示需要向左急转。

QGeoManeuver.DirectionLeft

该指令表示需要向左转。

QGeoManeuver.DirectionLightLeft

指示需要向左轻转。

QGeoManeuver.DirectionBearLeft

指示表示行驶方向应向左偏转。

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property directionᅟ: QGeoManeuver.InstructionDirection

此属性保存与相关指令关联的方向。

Access functions:
property distanceToNextInstructionᅟ: float

此属性保存了发出此指令的点与应发出下一个指令的点之间的距离,单位为米。

Access functions:
property extendedAttributesᅟ: Dictionary with keys of type .QString and values of type QVariant.

此属性保存与此操作相关的扩展属性。

Access functions:
property instructionTextᅟ: str

此属性保存文本导航说明。

Access functions:
property positionᅟ: QGeoCoordinate

此属性保存了instructionText应显示的位置。

Access functions:
property timeToNextInstructionᅟ: int

此属性保存估计的时间(以秒为单位),即从发出相关指令的点到应发出下一条指令的点所需的时间。

Access functions:
property validᅟ: bool

此属性表示此操作是否有效。

当没有需要附加到QGeoRouteSegment实例端点的信息时,使用无效操作。

Access functions:
property waypointᅟ: QGeoCoordinate

此属性保存与此操作相关的航点。

如果没有与此操作相关的航点,则此属性将持有一个无效的 QGeoCoordinate。

Access functions:
__init__()

构造一个无效的操作对象。

该操作将保持无效,直到调用setPosition()、setInstructionText()、setDirection()、setTimeToNextInstruction()、setDistanceToNextInstruction()或setWaypoint()之一。

__init__(other)
Parameters:

其他QGeoManeuver

other的内容构造一个操作对象。

direction()
Return type:

InstructionDirection

属性 directionᅟ 的获取器。

distanceToNextInstruction()
Return type:

浮点数

属性 distanceToNextInstructionᅟ 的获取器。

extendedAttributes()
Return type:

字典的键类型为 .QString,值类型为 QVariant。

属性 extendedAttributesᅟ 的获取器。

instructionText()
Return type:

字符串

属性 instructionTextᅟ 的获取器。

isValid()
Return type:

布尔

属性 validᅟ 的获取器。

__ne__(rhs)
Parameters:

rhsQGeoManeuver

Return type:

布尔

返回lhs操作是否不等于rhs

__eq__(rhs)
Parameters:

rhsQGeoManeuver

Return type:

布尔

返回lhs操作是否等于rhs

position()
Return type:

QGeoCoordinate

属性 positionᅟ 的获取器。

setDirection(direction)
Parameters:

方向InstructionDirection

setDistanceToNextInstruction(distance)
Parameters:

距离 – 浮点数

setExtendedAttributes(extendedAttributes)
Parameters:

extendedAttributes – 字典,键类型为 .QString,值类型为 QVariant。

setInstructionText(instructionText)
Parameters:

instructionText – str

setPosition(position)
Parameters:

位置QGeoCoordinate

setTimeToNextInstruction(secs)
Parameters:

秒数 – 整数

setWaypoint(coordinate)
Parameters:

坐标QGeoCoordinate

swap(other)
Parameters:

其他QGeoManeuver

timeToNextInstruction()
Return type:

整数

属性 timeToNextInstructionᅟ 的获取器。

waypoint()
Return type:

QGeoCoordinate

属性 waypointᅟ 的获取器。