Skip to content

PlaceAttribute

Qt Base Class: QPlaceAttribute

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

Base classes

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

⋔ Inheritance diagram

graph TD
  1473573464880["location.PlaceAttribute"]
  1473573381920["QtLocation.QPlaceAttribute"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473573381920 --> 1473573464880
  1473291690208 --> 1473573381920
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QPlaceAttribute

Represents generic attribute information about a place.

Source code in prettyqt\location\placeattribute.py
class PlaceAttribute(QtLocation.QPlaceAttribute):
    """Represents generic attribute information about a place."""

    def __init__(
        self,
        other_or_label: None | str | QtLocation.QPlaceAttribute = None,
        value: str | None = None,
    ):
        if isinstance(other_or_label, QtLocation.QPlaceAttribute):
            super().__init__(other_or_label)
        else:
            super().__init__()
            self.setLabel(other_or_label or "")
            self.setText(value or "")

    def __repr__(self):
        return get_repr(self, self.label(), self.text())

    def __str__(self):
        return f"{self.label()}: {self.text()}"

    def __bool__(self):
        return not self.isEmpty()