Skip to content

GeoCircle

Base classes

Name Children Inherits
GeoShapeMixin
prettyqt.positioning.geoshape
QGeoCircle
PySide6.QtPositioning
QGeoCircle(self, other: PySide6.QtPositioning.QGeoCircle, /, *, center: PySide6.QtPositioning.QGeoCoordinate | None \= None, radius: float | None \= None) -> None

⋔ Inheritance diagram

graph TD
  2218575208["positioning.GeoCircle"]
  2727036102["positioning.GeoShapeMixin"]
  2751680898["builtins.object"]
  3024449907["QtPositioning.QGeoCircle"]
  2678726727["QtPositioning.QGeoShape"]
  37984305["Shiboken.Object"]
  2727036102 --> 2218575208
  2751680898 --> 2727036102
  3024449907 --> 2218575208
  2678726727 --> 3024449907
  37984305 --> 2678726727
  2751680898 --> 37984305

🛈 DocStrings

Bases: GeoShapeMixin, QGeoCircle

Source code in prettyqt/positioning/geocircle.py
class GeoCircle(positioning.GeoShapeMixin, QtPositioning.QGeoCircle):
    def __init__(
        self,
        center_or_other: QtPositioning.QGeoShape
        | QtPositioning.QGeoCoordinate
        | tuple[float, float]
        | None = None,
        radius: float | None = None,
    ):
        match center_or_other:
            case None:
                super().__init__()
            case QtPositioning.QGeoShape():
                super().__init__(center_or_other)
            case tuple():
                center = QtPositioning.QGeoCoordinate(*center_or_other)
                super().__init__(center, -1 if radius is None else radius)
            case _:
                super().__init__(center_or_other, -1 if radius is None else radius)

    def __repr__(self):
        return get_repr(self, self.get_center(), self.radius())

    def get_center(self) -> positioning.GeoCoordinate:
        return positioning.GeoCoordinate(self.center())

:fa-brands-github: Show source on GitHub