The QGeoRouteSegment class represents a segment of a route. 更多...
头: | #include <QGeoRouteSegment> |
qmake: | QT += location |
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 ) |
A QGeoRouteSegment instance has information about the physical layout of the route segment, the length of the route and estimated time required to traverse the route segment and an optional QGeoManeuver associated with the beginning of the route segment.
QGeoRouteSegment instances can be thought of as edges on a routing graph, with QGeoManeuver instances as optional labels attached to the vertices of the graph.
[read-only]
distance
: const
qreal
This property holds the distance covered by this segment of the route, in meters.
访问函数:
qreal | distance () const |
[read-only]
maneuver
: const
QGeoManeuver
This property holds the maneuver for this route segment.
Holds an invalid QGeoManeuver if no information has been attached to the starting point of this route segment.
访问函数:
QGeoManeuver | maneuver () const |
[read-only]
path
: const
QList
<
QGeoCoordinate
>
This property holds the geometric shape of this route segment of the route.
The coordinates should be listed in the order in which they would be traversed by someone traveling along this segment of the route.
访问函数:
QList<QGeoCoordinate> | path () const |
[read-only]
travelTime
: const
int
This property holds the estimated amount of time, in seconds, that it will take to traverse this segment.
访问函数:
int | travelTime () const |
Constructs an invalid route segment object.
The route segment will remain invalid until one of setNextRouteSegment (), setTravelTime(), setDistance(), setPath() or setManeuver() is called.
Constructs a route segment object from the contents of other .
Destroys this route segment object.
Returns whether this route segment is the last segment of a route leg.
Returns whether this route segment is valid or not.
若 nextRouteSegment () is called on the last route segment of a route, the returned value will be an invalid route segment.
Returns the next route segment in the route.
Will return an invalid route segment if this is the last route segment in the route.
另请参阅 setNextRouteSegment ().
Sets the next route segment in the route to routeSegment .
另请参阅 nextRouteSegment ().
赋值 other to this route segment object and then returns a reference to this route segment object.
Returns whether the route segments lhs and rhs are not equal.
值 nextRouteSegment () is not considered in the comparison.
Returns whether the route segments lhs and rhs 相等。
值 nextRouteSegment () is not considered in the comparison.