Skip to content

GeoManeuver

Qt Base Class: QGeoManeuver

Signature: QGeoManeuver(self) -> None QGeoManeuver(self, other: PySide6.QtLocation.QGeoManeuver) -> None

Base classes

Name Children Inherits
QGeoManeuver
PySide6.QtLocation
QGeoManeuver(self) -> None

⋔ Inheritance diagram

graph TD
  1473573472688["location.GeoManeuver"]
  1473573400464["QtLocation.QGeoManeuver"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473573400464 --> 1473573472688
  1473291690208 --> 1473573400464
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QGeoManeuver

Represents info relevant to the point at which two QGeoRouteSegments meet.

Source code in prettyqt\location\geomaneuver.py
class GeoManeuver(QtLocation.QGeoManeuver):
    """Represents info relevant to the point at which two QGeoRouteSegments meet."""

    def __bool__(self):
        return self.isValid()

    def __str__(self):
        return self.instructionText()

    def __setitem__(self, index: str, val):
        attrs = self.extendedAttributes()
        attrs[index] = val
        self.setExtendedAttributes(attrs)

    def __getitem__(self, index: str):
        attr = self.extendedAttributes()
        if index not in attr:
            raise KeyError(f"Key {index!r} does not exist.")
        return attr[index]

    def get_position(self) -> positioning.GeoCoordinate:
        return positioning.GeoCoordinate(self.position())

    def get_waypoint(self) -> positioning.GeoCoordinate | None:
        wp = self.waypoint()
        return positioning.GeoCoordinate(wp) if wp.isValid() else None

    def set_direction(
        self,
        direction: InstructionDirectionStr | QtLocation.QGeoManeuver.InstructionDirection,
    ):
        """Set the direction.

        Args:
            direction: Direction
        """
        self.setDirection(INSTRUCTION_DIRECTION.get_enum_value(direction))

    def get_direction(self) -> InstructionDirectionStr:
        """Return current direction.

        Returns:
            Direction
        """
        return INSTRUCTION_DIRECTION.inverse[self.direction()]

get_direction() -> InstructionDirectionStr

Return current direction.

Source code in prettyqt\location\geomaneuver.py
def get_direction(self) -> InstructionDirectionStr:
    """Return current direction.

    Returns:
        Direction
    """
    return INSTRUCTION_DIRECTION.inverse[self.direction()]

set_direction(direction: InstructionDirectionStr | QtLocation.QGeoManeuver.InstructionDirection)

Set the direction.

Parameters:

Name Type Description Default
direction InstructionDirectionStr | InstructionDirection

Direction

required
Source code in prettyqt\location\geomaneuver.py
def set_direction(
    self,
    direction: InstructionDirectionStr | QtLocation.QGeoManeuver.InstructionDirection,
):
    """Set the direction.

    Args:
        direction: Direction
    """
    self.setDirection(INSTRUCTION_DIRECTION.get_enum_value(direction))