QGeoRouteSegment

The QGeoRouteSegment class represents a segment of a route. More

Inheritance diagram of PySide2.QtLocation.QGeoRouteSegment

Synopsis

Functions

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.

class PySide2.QtLocation.QGeoRouteSegment

PySide2.QtLocation.QGeoRouteSegment(other)

param other

PySide2.QtLocation.QGeoRouteSegment

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 .

PySide2.QtLocation.QGeoRouteSegment.distance()
Return type

float

Returns the distance covered by this segment of the route, in meters.

See also

setDistance()

PySide2.QtLocation.QGeoRouteSegment.isLegLastSegment()
Return type

bool

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

PySide2.QtLocation.QGeoRouteSegment.isValid()
Return type

bool

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.

PySide2.QtLocation.QGeoRouteSegment.maneuver()
Return type

PySide2.QtLocation.QGeoManeuver

Returns the maneuver for this route segment.

Will return an invalid QGeoManeuver if no information has been attached to the starting point of this route segment.

See also

setManeuver()

PySide2.QtLocation.QGeoRouteSegment.nextRouteSegment()
Return type

PySide2.QtLocation.QGeoRouteSegment

Returns the next route segment in the route.

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

PySide2.QtLocation.QGeoRouteSegment.__ne__(other)
Parameters

otherPySide2.QtLocation.QGeoRouteSegment

Return type

bool

Returns whether this route segment and other are not equal.

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

PySide2.QtLocation.QGeoRouteSegment.__eq__(other)
Parameters

otherPySide2.QtLocation.QGeoRouteSegment

Return type

bool

Returns whether this route segment and other are equal.

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

PySide2.QtLocation.QGeoRouteSegment.path()
Return type

Returns 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.

See also

setPath()

PySide2.QtLocation.QGeoRouteSegment.setDistance(distance)
Parameters

distance – float

Sets the distance covered by this segment of the route, in meters, to distance .

See also

distance()

PySide2.QtLocation.QGeoRouteSegment.setManeuver(maneuver)
Parameters

maneuverPySide2.QtLocation.QGeoManeuver

Sets the maneuver for this route segment to maneuver .

See also

maneuver()

PySide2.QtLocation.QGeoRouteSegment.setNextRouteSegment(routeSegment)
Parameters

routeSegmentPySide2.QtLocation.QGeoRouteSegment

Sets the next route segment in the route to routeSegment .

PySide2.QtLocation.QGeoRouteSegment.setPath(path)
Parameters

path

Sets the geometric shape of this segment of the route to path .

The coordinates in path should be listed in the order in which they would be traversed by someone traveling along this segment of the route.

See also

path()

PySide2.QtLocation.QGeoRouteSegment.setTravelTime(secs)
Parameters

secs – int

Sets the estimated amount of time it will take to traverse this segment of the route, in seconds, to secs .

See also

travelTime()

PySide2.QtLocation.QGeoRouteSegment.travelTime()
Return type

int

Returns the estimated amount of time it will take to traverse this segment of the route, in seconds.

See also

setTravelTime()