QGeoRouteSegment Class
QGeoRouteSegment 类表示一段路线。更多
Header: | #include <QGeoRouteSegment> |
qmake: | QT += location |
属性
- distance : const qreal
- maneuver : const QGeoManeuver
- path : const QList<QGeoCoordinate>
- travelTime : const int
公共职能
QGeoRouteSegment() | |
QGeoRouteSegment(const QGeoRouteSegment &other) | |
~QGeoRouteSegment() | |
qreal | distance() const |
bool | isLegLastSegment() const |
bool | isValid() const |
QGeoManeuver | maneuver() const |
QGeoRouteSegment | nextRouteSegment() const |
QList<QGeoCoordinate> | path() const |
void | setNextRouteSegment(const QGeoRouteSegment &routeSegment) |
int | travelTime() const |
QGeoRouteSegment & | operator=(const QGeoRouteSegment &other) |
相关非成员
bool | operator!=(const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs) |
bool | operator==(const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs) |
详细说明
QGeoRouteSegment 实例包含路线段的物理布局信息、路线长度、穿越路线段所需的预计时间以及与路线段起点相关的可选QGeoManeuver 。
QGeoRouteSegment 实例可视为路由图上的边,而QGeoManeuver 实例则是附在路由图顶点上的可选标签。
属性文档
[read-only]
distance : const qreal
该属性表示这段路线的距离,单位为米。
访问功能:
qreal | distance() const |
[read-only]
maneuver : const QGeoManeuver
此属性用于保存此航段的操纵信息。
如果该航段的起点未附加任何信息,则保存无效的QGeoManeuver 。
访问功能:
QGeoManeuver | maneuver() const |
[read-only]
path : const QList<QGeoCoordinate>
该属性表示该路线段的几何形状。
坐标应按照沿此路线段行进的顺序排列。
访问功能:
QList<QGeoCoordinate> | path() const |
[read-only]
travelTime : const int
该属性用于保存穿越该航段所需的预计时间(以秒为单位)。
访问函数:
int | travelTime() const |
成员函数文档
QGeoRouteSegment::QGeoRouteSegment()
构造一个无效航段对象。
在调用setNextRouteSegment()、setTravelTime()、setDistance()、setPath() 或 setManeuver() 之前,该航段将一直处于无效状态。
[noexcept]
QGeoRouteSegment::QGeoRouteSegment(const QGeoRouteSegment &other)
根据other 的内容构建路由段对象。
[noexcept]
QGeoRouteSegment::~QGeoRouteSegment()
销毁此路由段对象。
bool QGeoRouteSegment::isLegLastSegment() const
返回此航段是否为航段的最后一段。
bool QGeoRouteSegment::isValid() const
返回该路由段是否有效。
如果在路由的最后一个路由段上调用nextRouteSegment() ,返回值将是一个无效路由段。
QGeoRouteSegment QGeoRouteSegment::nextRouteSegment() const
返回路径中的下一个路径段。
如果这是路由中的最后一个路由段,则返回无效路由段。
另请参见 setNextRouteSegment()。
void QGeoRouteSegment::setNextRouteSegment(const QGeoRouteSegment &routeSegment)
将路由中的下一个路由段设置为routeSegment 。
另请参阅 nextRouteSegment()。
[noexcept]
QGeoRouteSegment &QGeoRouteSegment::operator=(const QGeoRouteSegment &other)
为该路由段对象指定other ,然后返回对该路由段对象的引用。
相关非成员
[noexcept]
bool operator!=(const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs)
返回路由段lhs 和rhs 是否不相等。
比较时不考虑nextRouteSegment() 的值。
[noexcept]
bool operator==(const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs)
返回路由段lhs 和rhs 是否相等。
比较时不考虑nextRouteSegment() 的值。
© 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.