IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QGeoRouteSegment Class

The QGeoRouteSegment class represents a segment of a route.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QGeoRouteSegment Class

  • Header: QGeoRouteSegment

  • qmake: QT += location

  • Group: QGeoRouteSegment is part of QtLocation-routing

I. Detailed Description

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.

II. Property Documentation

 

II-1. [read-only] distance : const qreal

This property holds the distance covered by this segment of the route, in meters.

Access functions:

  • distance() const

II-2. [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.

Access functions:

  • maneuver() const

II-3. [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.

Access functions:

  • <> path() const

II-4. [read-only] travelTime : const int

This property holds the estimated amount of time, in seconds, that it will take to traverse this segment.

Access functions:

  • int travelTime() const

III. Member Function Documentation

 

III-1. QGeoRouteSegment::QGeoRouteSegment()

Constructs an invalid route segment object.

The route segment will remain invalid until one of setNextRouteSegment(), setTravelTime(), setDistance(), setPath() or setManeuver() is called.

III-2. QGeoRouteSegment::QGeoRouteSegment(const QGeoRouteSegment &other)

Constructs a route segment object from the contents of other.

III-3. QGeoRouteSegment::~QGeoRouteSegment()

Destroys this route segment object.

III-4. bool QGeoRouteSegment::isLegLastSegment() const

Returns whether this route segment is the last segment of a route leg.

III-5. bool QGeoRouteSegment::isValid() const

Returns whether this route segment is valid or not.

If nextRouteSegment() is called on the last route segment of a route, the returned value will be an invalid route segment.

III-6. QGeoRouteSegment QGeoRouteSegment::nextRouteSegment() const

Returns the next route segment in the route.

Will return an invalid route segment if this is the last route segment in the route.

III-6-1. See Also

See also setNextRouteSegment()

III-7. void QGeoRouteSegment::setNextRouteSegment(const QGeoRouteSegment &routeSegment)

Sets the next route segment in the route to routeSegment.

III-7-1. See Also

See also nextRouteSegment()

III-8. QGeoRouteSegment &QGeoRouteSegment::operator=(const QGeoRouteSegment &other)

Assigns other to this route segment object and then returns a reference to this route segment object.

IV. Related Non-Members

 

IV-1. bool operator!=(const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs)

Returns whether the route segments lhs and rhs are not equal.

The value of nextRouteSegment() is not considered in the comparison.

IV-2. bool operator==(const QGeoRouteSegment &lhs, const QGeoRouteSegment &rhs)

Returns whether the route segments lhs and rhs are equal.

The value of nextRouteSegment() is not considered in the comparison.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+