QGeoRouteSegmentclass represents a segment of a route. 更多 …
def
__eq__
(other)
def
__ne__
(other)
def
distance
()
def
isLegLastSegment
()
def
isValid
()
def
maneuver
()
def
nextRouteSegment
()
def
path
()
def
setDistance
(distance)
def
setManeuver
(maneuver)
def
setNextRouteSegment
(routeSegment)
def
setPath
(path)
def
setTravelTime
(secs)
def
travelTime
()
A
QGeoRouteSegmentinstance 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 optionalQGeoManeuverassociated with the beginning of the route segment.
QGeoRouteSegmentinstances can be thought of as edges on a routing graph, withQGeoManeuverinstances as optional labels attached to the vertices of the graph.
QGeoRouteSegment
¶
QGeoRouteSegment(other)
- param other
Constructs an invalid route segment object.
The route segment will remain invalid until one of
setNextRouteSegment()
,
setTravelTime()
,
setDistance()
,
setPath()
or
setManeuver()
被调用。
Constructs a route segment object from the contents of
other
.
PySide2.QtLocation.QGeoRouteSegment.
distance
(
)
¶
qreal
Returns the distance covered by this segment of the route, in meters.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
isLegLastSegment
(
)
¶
bool
Returns whether this route segment is the last segment of a route leg.
PySide2.QtLocation.QGeoRouteSegment.
isValid
(
)
¶
bool
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.
PySide2.QtLocation.QGeoRouteSegment.
maneuver
(
)
¶
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.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
nextRouteSegment
(
)
¶
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
)
¶
other
–
QGeoRouteSegment
bool
Returns whether this route segment and
other
are not equal.
值
nextRouteSegment()
is not considered in the comparison.
PySide2.QtLocation.QGeoRouteSegment.
__eq__
(
other
)
¶
other
–
QGeoRouteSegment
bool
Returns whether this route segment and
other
are equal.
值
nextRouteSegment()
is not considered in the comparison.
PySide2.QtLocation.QGeoRouteSegment.
path
(
)
¶
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.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
setDistance
(
distance
)
¶
distance
–
qreal
Sets the distance covered by this segment of the route, in meters, to
distance
.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
setManeuver
(
maneuver
)
¶
maneuver
–
QGeoManeuver
Sets the maneuver for this route segment to
maneuver
.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
setNextRouteSegment
(
routeSegment
)
¶
routeSegment
–
QGeoRouteSegment
Sets the next route segment in the route to
routeSegment
.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
setPath
(
path
)
¶
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.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
setTravelTime
(
secs
)
¶
secs
–
int
Sets the estimated amount of time it will take to traverse this segment of the route, in seconds, to
secs
.
另请参阅
PySide2.QtLocation.QGeoRouteSegment.
travelTime
(
)
¶
int
Returns the estimated amount of time it will take to traverse this segment of the route, in seconds.
另请参阅