Skip to content

GeoPath

Qt Base Class: QGeoPath

Signature: QGeoPath(self) -> None QGeoPath(self, other: PySide6.QtPositioning.QGeoShape) -> None QGeoPath(self, other: Union[PySide6.QtPositioning.QGeoPath, PySide6.QtPositioning.QGeoShape, Sequence[PySide6.QtPositioning.QGeoCoordinate]]) -> None QGeoPath(self, path: Sequence[PySide6.QtPositioning.QGeoCoordinate], width: float = 0.0) -> None

Base classes

Name Children Inherits
GeoShapeMixin
prettyqt.positioning.geoshape
QGeoPath
PySide6.QtPositioning
QGeoPath(self) -> None

⋔ Inheritance diagram

graph TD
  1473573456096["positioning.GeoPath"]
  1473573419984["positioning.GeoShapeMixin"]
  140713234304496["builtins.object"]
  1473573339952["QtPositioning.QGeoPath"]
  1473573320432["QtPositioning.QGeoShape"]
  1473291690208["Shiboken.Object"]
  1473573419984 --> 1473573456096
  140713234304496 --> 1473573419984
  1473573339952 --> 1473573456096
  1473573320432 --> 1473573339952
  1473291690208 --> 1473573320432
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: GeoShapeMixin, QGeoPath

Source code in prettyqt\positioning\geopath.py
class GeoPath(positioning.GeoShapeMixin, QtPositioning.QGeoPath):
    def __len__(self):
        return self.size()

    def __getitem__(self, index: int) -> positioning.GeoCoordinate:
        return positioning.GeoCoordinate(self.coordinateAt(index))

    def __setitem__(self, index: int, value: QtPositioning.QGeoCoordinate):
        self.replaceCoordinate(index, value)

    def __delitem__(self, index: int):
        self.removeCoordinate(index)

    def __add__(self, other: QtPositioning.QGeoCoordinate):
        self.addCoordinate(other)
        return self

    def __repr__(self):
        # p = ", ".join([f"{p!r}" for p in self.get_path()])
        return f"{type(self).__name__}(<{len(self)} points>)"

    def get_path(self) -> list[positioning.GeoCoordinate]:
        return [positioning.GeoCoordinate(p) for p in self.path()]