Skip to content

location

Class info

Classes

Name Children Inherits
GeoCodingManager
prettyqt.location.geocodingmanager
Support for geocoding operations.
    GeoManeuver
    prettyqt.location.geomaneuver
    Represents info relevant to the point at which two QGeoRouteSegments meet.
      GeoRoute
      prettyqt.location.georoute
      Represents a route between two points.
        GeoRouteMixin
        prettyqt.location.georoute
        GeoRouteRequest
        prettyqt.location.georouterequest
        Represents the params and restrictions defining a routing information request.
          GeoRouteSegment
          prettyqt.location.georoutesegment
          Represents a segment of a route.
            GeoRoutingManager
            prettyqt.location.georoutingmanager
            Support for geographic routing operations.
              GeoServiceProvider
              prettyqt.location.geoserviceprovider
              Aggregates access to services which provide geographical information.
                Place
                prettyqt.location.place
                Represents a set of data about a place.
                  PlaceAttribute
                  prettyqt.location.placeattribute
                  Represents generic attribute information about a place.
                    PlaceCategory
                    prettyqt.location.placecategory
                    Represents a category that a QPlace can be associated with.
                      PlaceContactDetail
                      prettyqt.location.placecontactdetail
                      Represents a contact detail such as a phone number or website url.
                        PlaceContent
                        prettyqt.location.placecontent
                        Holds content about places.
                          PlaceContentMixin
                          prettyqt.location.placecontent
                          PlaceContentReply
                          prettyqt.location.placecontentreply
                          Manages a content retrieval operation started by an instance of QPlaceManager.
                            PlaceContentRequest
                            prettyqt.location.placecontentrequest
                            Represents the parameters of a content request.
                              PlaceDetailsReply
                              prettyqt.location.placedetailsreply
                              Manages a place details fetch operation started by an instance of QPlaceManager.
                                PlaceIcon
                                prettyqt.location.placeicon
                                Represents an icon.
                                  PlaceIdReply
                                  prettyqt.location.placeidreply
                                  Manages saving and removal operations of places and categories.
                                    PlaceManager
                                    prettyqt.location.placemanager
                                    An interface allowing clients to access places stored in a particular backend.
                                      PlaceMatchReply
                                      prettyqt.location.placematchreply
                                      Manages a place matching operation started by an instance of QPlaceManager.
                                        PlaceMatchRequest
                                        prettyqt.location.placematchrequest
                                          PlaceProposedSearchResult
                                          prettyqt.location.placeproposedsearchresult
                                          Represents a search result containing a proposed search.
                                            PlaceRatings
                                            prettyqt.location.placeratings
                                            Holds rating information about a place.
                                              PlaceReply
                                              prettyqt.location.placereply
                                                PlaceReplyMixin
                                                prettyqt.location.placereply
                                                PlaceResult
                                                prettyqt.location.placeresult
                                                Represents a search result containing a place.
                                                  PlaceSearchReply
                                                  prettyqt.location.placesearchreply
                                                  Manages a place search operation started by an instance of QPlaceManager.
                                                    PlaceSearchRequest
                                                    prettyqt.location.placesearchrequest
                                                    Represents the set of parameters for a search request.
                                                      PlaceSearchResult
                                                      prettyqt.location.placesearchresult
                                                      The base class for search results.
                                                        PlaceSearchResultMixin
                                                        prettyqt.location.placesearchresult
                                                        PlaceSupplier
                                                        prettyqt.location.placesupplier
                                                          PlaceUser
                                                          prettyqt.location.placeuser
                                                          Represents an individual user.

                                                            🛈 DocStrings

                                                            Provides interfaces to create location-aware applications.

                                                            GeoCodingManager

                                                            Bases: ObjectMixin

                                                            Support for geocoding operations.

                                                            Source code in prettyqt/location/geocodingmanager.py
                                                            class GeoCodingManager(core.ObjectMixin):
                                                                """Support for geocoding operations."""
                                                            
                                                                def __init__(self, item: QtLocation.QGeoCodingManager):
                                                                    self.item = item
                                                            
                                                                def __getattr__(self, val):
                                                                    return getattr(self.item, val)
                                                            
                                                                def get_locale(self) -> core.Locale:
                                                                    return core.Locale(self.item.locale())
                                                            

                                                            GeoManeuver

                                                            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:
                                                                        msg = f"Key {index!r} does not exist."
                                                                        raise KeyError(msg)
                                                                    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))
                                                            

                                                            GeoRoute

                                                            Bases: GeoRouteMixin, QGeoRoute

                                                            Represents a route between two points.

                                                            Source code in prettyqt/location/georoute.py
                                                            class GeoRoute(GeoRouteMixin, location.QGeoRoute):
                                                                """Represents a route between two points."""
                                                            

                                                            GeoRouteRequest

                                                            Bases: QGeoRouteRequest

                                                            Represents the params and restrictions defining a routing information request.

                                                            Source code in prettyqt/location/georouterequest.py
                                                            class GeoRouteRequest(QtLocation.QGeoRouteRequest):
                                                                """Represents the params and restrictions defining a routing information request."""
                                                            
                                                                def get_waypoints(self) -> list[positioning.GeoCoordinate]:
                                                                    return [positioning.GeoCoordinate(wp) for wp in self.waypoints()]
                                                            
                                                                def get_exclude_areas(self) -> list[positioning.GeoRectangle]:
                                                                    return [positioning.GeoRectangle(wp) for wp in self.excludeAreas()]
                                                            
                                                                def get_departure_time(self) -> core.DateTime:
                                                                    return core.DateTime(self.departureTime())
                                                            
                                                                def set_feature_weight(
                                                                    self,
                                                                    feature: FeatureTypeStr | QtLocation.QGeoRouteRequest.FeatureType,
                                                                    weight: FeatureWeightStr | QtLocation.QGeoRouteRequest.FeatureWeight,
                                                                ):
                                                                    """Set the feature weight.
                                                            
                                                                    Args:
                                                                        feature: Feature type
                                                                        weight: Feature weight
                                                                    """
                                                                    self.setFeatureWeight(
                                                                        FEATURE_TYPES.get_enum_value(feature), FEATURE_WEIGHTS.get_enum_value(weight)
                                                                    )
                                                            
                                                                def get_feature_weight(
                                                                    self, feature: FeatureTypeStr | QtLocation.QGeoRouteRequest.FeatureType
                                                                ) -> FeatureWeightStr:
                                                                    """Return current feature weight.
                                                            
                                                                    Returns:
                                                                        Feature weight
                                                                    """
                                                                    return FEATURE_WEIGHTS.inverse[
                                                                        self.featureWeight(FEATURE_TYPES.get_enum_value(feature))
                                                                    ]
                                                            
                                                                def set_route_optimization(
                                                                    self,
                                                                    optimization: RouteOptimizationStr
                                                                    | QtLocation.QGeoRouteRequest.RouteOptimization,
                                                                ):
                                                                    """Set the route optimization.
                                                            
                                                                    Args:
                                                                        optimization: Route optimization
                                                                    """
                                                                    self.setRouteOptimization(ROUTE_OPTIMIZATION.get_enum_value(optimization))
                                                            
                                                                def get_route_optimization(self) -> list[RouteOptimizationStr]:
                                                                    """Return current route optimization.
                                                            
                                                                    Returns:
                                                                        Route optimization
                                                                    """
                                                                    return ROUTE_OPTIMIZATION.get_list(self.routeOptimization())
                                                            
                                                                def get_travel_modes(self) -> list[TravelModeStr]:
                                                                    return TRAVEL_MODE.get_list(self.travelModes())
                                                            
                                                                def set_travel_modes(self, *mode: TravelModeStr):
                                                                    flags = TRAVEL_MODE.merge_flags(mode)
                                                                    self.setTravelModes(flags)
                                                            
                                                                def get_feature_types(self) -> list[FeatureTypeStr]:
                                                                    return [k for k, v in FEATURE_TYPES.items() for t in self.featureTypes() if v & t]
                                                            

                                                            get_feature_weight(feature: FeatureTypeStr | QtLocation.QGeoRouteRequest.FeatureType) -> FeatureWeightStr

                                                            Return current feature weight.

                                                            Source code in prettyqt/location/georouterequest.py
                                                            def get_feature_weight(
                                                                self, feature: FeatureTypeStr | QtLocation.QGeoRouteRequest.FeatureType
                                                            ) -> FeatureWeightStr:
                                                                """Return current feature weight.
                                                            
                                                                Returns:
                                                                    Feature weight
                                                                """
                                                                return FEATURE_WEIGHTS.inverse[
                                                                    self.featureWeight(FEATURE_TYPES.get_enum_value(feature))
                                                                ]
                                                            

                                                            get_route_optimization() -> list[RouteOptimizationStr]

                                                            Return current route optimization.

                                                            Source code in prettyqt/location/georouterequest.py
                                                            def get_route_optimization(self) -> list[RouteOptimizationStr]:
                                                                """Return current route optimization.
                                                            
                                                                Returns:
                                                                    Route optimization
                                                                """
                                                                return ROUTE_OPTIMIZATION.get_list(self.routeOptimization())
                                                            

                                                            set_feature_weight(feature: FeatureTypeStr | QtLocation.QGeoRouteRequest.FeatureType, weight: FeatureWeightStr | QtLocation.QGeoRouteRequest.FeatureWeight)

                                                            Set the feature weight.

                                                            Parameters:

                                                            Name Type Description Default
                                                            feature FeatureTypeStr | FeatureType

                                                            Feature type

                                                            required
                                                            weight FeatureWeightStr | FeatureWeight

                                                            Feature weight

                                                            required
                                                            Source code in prettyqt/location/georouterequest.py
                                                            def set_feature_weight(
                                                                self,
                                                                feature: FeatureTypeStr | QtLocation.QGeoRouteRequest.FeatureType,
                                                                weight: FeatureWeightStr | QtLocation.QGeoRouteRequest.FeatureWeight,
                                                            ):
                                                                """Set the feature weight.
                                                            
                                                                Args:
                                                                    feature: Feature type
                                                                    weight: Feature weight
                                                                """
                                                                self.setFeatureWeight(
                                                                    FEATURE_TYPES.get_enum_value(feature), FEATURE_WEIGHTS.get_enum_value(weight)
                                                                )
                                                            

                                                            set_route_optimization(optimization: RouteOptimizationStr | QtLocation.QGeoRouteRequest.RouteOptimization)

                                                            Set the route optimization.

                                                            Parameters:

                                                            Name Type Description Default
                                                            optimization RouteOptimizationStr | RouteOptimization

                                                            Route optimization

                                                            required
                                                            Source code in prettyqt/location/georouterequest.py
                                                            def set_route_optimization(
                                                                self,
                                                                optimization: RouteOptimizationStr
                                                                | QtLocation.QGeoRouteRequest.RouteOptimization,
                                                            ):
                                                                """Set the route optimization.
                                                            
                                                                Args:
                                                                    optimization: Route optimization
                                                                """
                                                                self.setRouteOptimization(ROUTE_OPTIMIZATION.get_enum_value(optimization))
                                                            

                                                            GeoRouteSegment

                                                            Bases: QGeoRouteSegment

                                                            Represents a segment of a route.

                                                            Source code in prettyqt/location/georoutesegment.py
                                                            class GeoRouteSegment(location.QGeoRouteSegment):
                                                                """Represents a segment of a route."""
                                                            
                                                                def __bool__(self):
                                                                    return self.isValid()
                                                            
                                                                def __abs__(self) -> float:
                                                                    return self.distance()
                                                            
                                                                def get_maneuver(self) -> location.GeoManeuver:
                                                                    return location.GeoManeuver(self.maneuver())
                                                            
                                                                def get_path(self) -> list[positioning.GeoCoordinate]:
                                                                    return [positioning.GeoCoordinate(i) for i in self.path()]
                                                            

                                                            GeoRoutingManager

                                                            Bases: ObjectMixin

                                                            Support for geographic routing operations.

                                                            Source code in prettyqt/location/georoutingmanager.py
                                                            class GeoRoutingManager(core.ObjectMixin):
                                                                """Support for geographic routing operations."""
                                                            
                                                                def __init__(self, item: location.QGeoRoutingManager):
                                                                    self.item = item
                                                            
                                                                def __getattr__(self, val):
                                                                    return getattr(self.item, val)
                                                            
                                                                def get_locale(self) -> core.Locale:
                                                                    return core.Locale(self.item.locale())
                                                            
                                                                def get_supported_feature_types(
                                                                    self,
                                                                ) -> list[location.georouterequest.FeatureTypeStr]:
                                                                    return location.georouterequest.FEATURE_TYPES.get_list(
                                                                        self.item.supportedFeatureTypes()
                                                                    )
                                                            
                                                                def get_supported_feature_weights(
                                                                    self,
                                                                ) -> list[location.georouterequest.FeatureWeightStr]:
                                                                    return location.georouterequest.FEATURE_WEIGHTS.get_list(
                                                                        self.item.supportedFeatureWeights()
                                                                    )
                                                            
                                                                def get_supported_maneuver_details(
                                                                    self,
                                                                ) -> list[location.georouterequest.ManeuverDetailStr]:
                                                                    return location.georouterequest.MANEUVER_DETAIL.get_list(
                                                                        self.item.supportedManeuverDetails()
                                                                    )
                                                            
                                                                def get_supported_route_optimizations(
                                                                    self,
                                                                ) -> list[location.georouterequest.RouteOptimizationStr]:
                                                                    return location.georouterequest.ROUTE_OPTIMIZATION.get_list(
                                                                        self.item.supportedRouteOptimizations()
                                                                    )
                                                            
                                                                def get_supported_segment_details(
                                                                    self,
                                                                ) -> list[location.georouterequest.SegmentDetailStr]:
                                                                    return location.georouterequest.SEGMENT_DETAIL.get_list(
                                                                        self.item.supportedSegmentDetails()
                                                                    )
                                                            
                                                                def get_supported_travel_modes(self) -> list[location.georouterequest.TravelModeStr]:
                                                                    return location.georouterequest.TRAVEL_MODE.get_list(
                                                                        self.item.supportedTravelModes()
                                                                    )
                                                            

                                                            GeoServiceProvider

                                                            Bases: ObjectMixin, QGeoServiceProvider

                                                            Aggregates access to services which provide geographical information.

                                                            Source code in prettyqt/location/geoserviceprovider.py
                                                            class GeoServiceProvider(core.ObjectMixin, location.QGeoServiceProvider):
                                                                """Aggregates access to services which provide geographical information."""
                                                            
                                                                def get_error(self) -> ErrorStr:
                                                                    return ERROR.inverse[self.error()]
                                                            
                                                                def get_geocoding_error(self) -> ErrorStr:
                                                                    return ERROR.inverse[self.geocodingError()]
                                                            
                                                                def get_geocoding_features(self) -> list[GeocodingFeatureStr]:
                                                                    return GEOCODING_FEATURES.get_list(self.geocodingFeatures())
                                                            
                                                                def get_mapping_error(self) -> ErrorStr:
                                                                    return ERROR.inverse[self.mappingError()]
                                                            
                                                                def get_mapping_features(self) -> list[MappingFeatureStr]:
                                                                    return MAPPING_FEATURES.get_list(self.mappingFeatures())
                                                            
                                                                def get_navigation_error(self) -> ErrorStr:
                                                                    return ERROR.inverse[self.navigationError()]
                                                            
                                                                def get_navigation_features(self) -> list[NavigationFeatureStr]:
                                                                    return NAVIGATION_FEATURES.get_list(self.navigationFeatures())
                                                            
                                                                def get_places_error(self) -> ErrorStr:
                                                                    return ERROR.inverse[self.placesError()]
                                                            
                                                                def get_places_features(self) -> list[PlaceFeatureStr]:
                                                                    return PLACES_FEATURES.get_list(self.placesFeatures())
                                                            
                                                                def get_routing_error(self) -> ErrorStr:
                                                                    return ERROR.inverse[self.routingError()]
                                                            
                                                                def get_routing_features(self) -> list[RoutingFeatureStr]:
                                                                    return ROUTING_FEATURES.get_list(self.routingFeatures())
                                                            
                                                                def get_geocoding_manager(self) -> location.GeoCodingManager | None:
                                                                    manager = self.geocodingManager()
                                                                    return location.GeoCodingManager(manager) if manager is not None else None
                                                            
                                                                def get_routing_manager(self) -> location.GeoRoutingManager | None:
                                                                    manager = self.routingManager()
                                                                    return location.GeoRoutingManager(manager) if manager is not None else None
                                                            
                                                                def get_place_manager(self) -> location.PlaceManager | None:
                                                                    manager = self.placeManager()
                                                                    return location.PlaceManager(manager) if manager is not None else None
                                                            

                                                            Place

                                                            Bases: QPlace

                                                            Represents a set of data about a place.

                                                            Source code in prettyqt/location/place.py
                                                            class Place(location.QPlace):
                                                                """Represents a set of data about a place."""
                                                            
                                                                def __bool__(self):
                                                                    return not self.isEmpty()
                                                            
                                                                def __setitem__(self, index: str, val: location.QPlaceAttribute | None):
                                                                    if val is None:
                                                                        val = location.PlaceAttribute()
                                                                    self.setExtendedAttribute(index, val)
                                                            
                                                                def __getitem__(self, index: str) -> location.PlaceAttribute:
                                                                    attr = self.extendedAttribute(index)
                                                                    return location.PlaceAttribute(attr)
                                                            
                                                                def get_categories(self) -> list[location.PlaceCategory]:
                                                                    return [location.PlaceCategory(i) for i in self.categories()]
                                                            
                                                                def get_contact_details(self, contact_type: str) -> list[location.PlaceContactDetail]:
                                                                    return [location.PlaceContactDetail(i) for i in self.contactDetails(contact_type)]
                                                            
                                                                def set_content(self, typ: str, value: dict[int, location.QPlaceContent]):
                                                                    self.setContent(location.placecontent.TYPE.get_enum_value(typ), value)
                                                            
                                                                def get_content(self, typ: str) -> dict[int, location.QPlaceContent]:
                                                                    return self.content(location.placecontent.TYPE.get_enum_value(typ))
                                                            
                                                                def get_icon(self) -> location.PlaceIcon | None:
                                                                    icon = self.icon()
                                                                    return None if icon.isEmpty() else location.PlaceIcon(icon)
                                                            
                                                                def get_location(self) -> positioning.GeoLocation:
                                                                    return positioning.GeoLocation(self.location())
                                                            
                                                                def get_primary_website(self) -> core.Url:
                                                                    return core.Url(self.primaryWebsite())
                                                            
                                                                def get_ratings(self) -> location.PlaceRatings:
                                                                    return location.PlaceRatings(self.ratings())
                                                            
                                                                def get_supplier(self) -> location.PlaceSupplier:
                                                                    return location.PlaceSupplier(self.supplier())
                                                            
                                                                def get_visibility(self) -> location.VisibilityStr:
                                                                    """Return visibility.
                                                            
                                                                    Returns:
                                                                        Visibility
                                                                    """
                                                                    return location.VISIBILITY.inverse[self.visibility()]
                                                            

                                                            get_visibility() -> location.VisibilityStr

                                                            Return visibility.

                                                            Source code in prettyqt/location/place.py
                                                            def get_visibility(self) -> location.VisibilityStr:
                                                                """Return visibility.
                                                            
                                                                Returns:
                                                                    Visibility
                                                                """
                                                                return location.VISIBILITY.inverse[self.visibility()]
                                                            

                                                            PlaceAttribute

                                                            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: str | QtLocation.QPlaceAttribute | None = 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()
                                                            

                                                            PlaceCategory

                                                            Bases: QPlaceCategory

                                                            Represents a category that a QPlace can be associated with.

                                                            Source code in prettyqt/location/placecategory.py
                                                            class PlaceCategory(location.QPlaceCategory):
                                                                """Represents a category that a QPlace can be associated with."""
                                                            
                                                                def __str__(self):
                                                                    return self.name()
                                                            
                                                                def __bool__(self):
                                                                    return not self.isEmpty()
                                                            
                                                                def get_icon(self) -> location.PlaceIcon | None:
                                                                    icon = self.icon()
                                                                    return None if icon.isEmpty() else location.PlaceIcon(icon)
                                                            
                                                                def get_visibility(self) -> location.VisibilityStr:
                                                                    """Return the visibility of the place.
                                                            
                                                                    Returns:
                                                                        Visibility
                                                                    """
                                                                    return location.VISIBILITY.inverse[self.visibility()]
                                                            

                                                            get_visibility() -> location.VisibilityStr

                                                            Return the visibility of the place.

                                                            Source code in prettyqt/location/placecategory.py
                                                            def get_visibility(self) -> location.VisibilityStr:
                                                                """Return the visibility of the place.
                                                            
                                                                Returns:
                                                                    Visibility
                                                                """
                                                                return location.VISIBILITY.inverse[self.visibility()]
                                                            

                                                            PlaceContactDetail

                                                            Bases: QPlaceContactDetail

                                                            Represents a contact detail such as a phone number or website url.

                                                            Source code in prettyqt/location/placecontactdetail.py
                                                            class PlaceContactDetail(QtLocation.QPlaceContactDetail):
                                                                """Represents a contact detail such as a phone number or website url."""
                                                            
                                                                def __init__(
                                                                    self,
                                                                    other_or_label: str | QtLocation.QPlaceContactDetail | None = None,
                                                                    value: str | None = None,
                                                                ):
                                                                    if isinstance(other_or_label, QtLocation.QPlaceContactDetail):
                                                                        super().__init__(other_or_label)
                                                                    else:
                                                                        super().__init__()
                                                                        self.setLabel(other_or_label or "")
                                                                        self.setValue(value or "")
                                                            
                                                                def __repr__(self):
                                                                    return get_repr(self, self.label(), self.value())
                                                            
                                                                def __str__(self):
                                                                    return f"{self.label()}: {self.value()}"
                                                            

                                                            PlaceContent

                                                            Bases: PlaceContentMixin, QPlaceContent

                                                            Holds content about places.

                                                            Source code in prettyqt/location/placecontent.py
                                                            class PlaceContent(PlaceContentMixin, location.QPlaceContent):
                                                                """Holds content about places."""
                                                            

                                                            PlaceContentMixin

                                                            Bases: _PlaceContentBase

                                                            Source code in prettyqt/location/placecontent.py
                                                            class PlaceContentMixin(_PlaceContentBase):
                                                                def get_type(self) -> TypeStr:
                                                                    """Return the content type.
                                                            
                                                                    Returns:
                                                                        Content type
                                                                    """
                                                                    return TYPE.inverse[self.type()]
                                                            
                                                                def get_user(self) -> location.PlaceUser:
                                                                    return location.PlaceUser(self.user())
                                                            
                                                                def get_supplier(self) -> location.PlaceSupplier:
                                                                    return location.PlaceSupplier(self.supplier())
                                                            

                                                            get_type() -> TypeStr

                                                            Return the content type.

                                                            Source code in prettyqt/location/placecontent.py
                                                            def get_type(self) -> TypeStr:
                                                                """Return the content type.
                                                            
                                                                Returns:
                                                                    Content type
                                                                """
                                                                return TYPE.inverse[self.type()]
                                                            

                                                            PlaceContentReply

                                                            Bases: PlaceReplyMixin, QPlaceContentReply

                                                            Manages a content retrieval operation started by an instance of QPlaceManager.

                                                            Source code in prettyqt/location/placecontentreply.py
                                                            class PlaceContentReply(location.PlaceReplyMixin, location.QPlaceContentReply):
                                                                """Manages a content retrieval operation started by an instance of QPlaceManager."""
                                                            
                                                                def __len__(self):
                                                                    return self.totalCount()
                                                            
                                                                @classmethod
                                                                def clone_from(cls, obj: location.QPlaceContentReply) -> Self:
                                                                    reply = cls(obj.parent())
                                                                    reply.setContent(obj.content())
                                                                    reply.setTotalCount(obj.totalCount())
                                                                    request = location.PlaceContentRequest(obj.nextPageRequest())
                                                                    reply.setNextPageRequest(request)
                                                                    request = location.PlaceContentRequest(obj.previousPageRequest())
                                                                    reply.setPreviousPageRequest(request)
                                                                    request = location.PlaceContentRequest(obj.request())
                                                                    reply.setRequest(request)
                                                                    return reply
                                                            
                                                                def get_next_page_request(self) -> location.PlaceContentRequest:
                                                                    return location.PlaceContentRequest(self.nextPageRequest())
                                                            
                                                                def get_previous_page_request(self) -> location.PlaceContentRequest:
                                                                    return location.PlaceContentRequest(self.previousPageRequest())
                                                            
                                                                def get_request(self) -> location.PlaceContentRequest:
                                                                    return location.PlaceContentRequest(self.request())
                                                            

                                                            PlaceContentRequest

                                                            Bases: QPlaceContentRequest

                                                            Represents the parameters of a content request.

                                                            Source code in prettyqt/location/placecontentrequest.py
                                                            class PlaceContentRequest(location.QPlaceContentRequest):
                                                                """Represents the parameters of a content request."""
                                                            
                                                                def set_content_type(
                                                                    self, typ: location.placecontent.TypeStr | location.PlaceContent.Type
                                                                ):
                                                                    """Set the content type.
                                                            
                                                                    Args:
                                                                        typ: Content type
                                                                    """
                                                                    self.setContentType(location.placecontent.TYPE.get_enum_value(typ))
                                                            
                                                                def get_content_type(self) -> location.placecontent.TypeStr:
                                                                    """Return current content type.
                                                            
                                                                    Returns:
                                                                        Content type
                                                                    """
                                                                    return location.placecontent.TYPE.inverse[self.contentType()]
                                                            

                                                            get_content_type() -> location.placecontent.TypeStr

                                                            Return current content type.

                                                            Source code in prettyqt/location/placecontentrequest.py
                                                            def get_content_type(self) -> location.placecontent.TypeStr:
                                                                """Return current content type.
                                                            
                                                                Returns:
                                                                    Content type
                                                                """
                                                                return location.placecontent.TYPE.inverse[self.contentType()]
                                                            

                                                            set_content_type(typ: location.placecontent.TypeStr | location.PlaceContent.Type)

                                                            Set the content type.

                                                            Parameters:

                                                            Name Type Description Default
                                                            typ TypeStr | Type

                                                            Content type

                                                            required
                                                            Source code in prettyqt/location/placecontentrequest.py
                                                            def set_content_type(
                                                                self, typ: location.placecontent.TypeStr | location.PlaceContent.Type
                                                            ):
                                                                """Set the content type.
                                                            
                                                                Args:
                                                                    typ: Content type
                                                                """
                                                                self.setContentType(location.placecontent.TYPE.get_enum_value(typ))
                                                            

                                                            PlaceDetailsReply

                                                            Bases: PlaceReplyMixin, QPlaceDetailsReply

                                                            Manages a place details fetch operation started by an instance of QPlaceManager.

                                                            Source code in prettyqt/location/placedetailsreply.py
                                                            class PlaceDetailsReply(location.PlaceReplyMixin, location.QPlaceDetailsReply):
                                                                """Manages a place details fetch operation started by an instance of QPlaceManager."""
                                                            
                                                                @classmethod
                                                                def clone_from(cls, obj: location.QPlaceDetailsReply) -> Self:
                                                                    reply = cls(obj.parent())
                                                                    reply.setPlace(location.Place(obj.place()))
                                                                    return reply
                                                            
                                                                def get_place(self) -> location.Place:
                                                                    return location.Place(self.place())
                                                            

                                                            PlaceIcon

                                                            Bases: QPlaceIcon

                                                            Represents an icon.

                                                            Source code in prettyqt/location/placeicon.py
                                                            class PlaceIcon(QtLocation.QPlaceIcon):
                                                                """Represents an icon."""
                                                            
                                                                def __bool__(self):
                                                                    return not self.isEmpty()
                                                            
                                                                def __setitem__(self, index: str, val: datatypes.Variant):
                                                                    attrs = self.parameters()
                                                                    attrs[index] = val
                                                                    self.setParameters(attrs)
                                                            
                                                                def __getitem__(self, index: str) -> datatypes.Variant:
                                                                    attr = self.parameters()
                                                                    if index not in attr:
                                                                        msg = f"Key {index!r} does not exist."
                                                                        raise KeyError(msg)
                                                                    return attr[index]
                                                            
                                                                # def get_manager(self) -> location.PlaceManager:
                                                                #     return location.PlaceManager(self.manager())
                                                            
                                                                def get_url(self) -> core.Url:
                                                                    return core.Url(self.url())
                                                            

                                                            PlaceIdReply

                                                            Bases: PlaceReplyMixin, QPlaceIdReply

                                                            Manages saving and removal operations of places and categories.

                                                            Source code in prettyqt/location/placeidreply.py
                                                            class PlaceIdReply(location.PlaceReplyMixin, location.QPlaceIdReply):
                                                                """Manages saving and removal operations of places and categories."""
                                                            
                                                                def __repr__(self):
                                                                    return get_repr(self, self.operationType())
                                                            
                                                                @classmethod
                                                                def clone_from(cls, obj: location.QPlaceIdReply) -> Self:
                                                                    reply = cls(obj.operationType(), obj.parent())
                                                                    reply.setId(obj.id())
                                                                    return reply
                                                            
                                                                def get_operation_type(self) -> OperationTypeStr:
                                                                    """Get current operation_type.
                                                            
                                                                    Returns:
                                                                        current operation_type
                                                                    """
                                                                    return OPERATION_TYPES.inverse[self.operationType()]
                                                            

                                                            get_operation_type() -> OperationTypeStr

                                                            Get current operation_type.

                                                            Source code in prettyqt/location/placeidreply.py
                                                            def get_operation_type(self) -> OperationTypeStr:
                                                                """Get current operation_type.
                                                            
                                                                Returns:
                                                                    current operation_type
                                                                """
                                                                return OPERATION_TYPES.inverse[self.operationType()]
                                                            

                                                            PlaceManager

                                                            Bases: Object

                                                            An interface allowing clients to access places stored in a particular backend.

                                                            Source code in prettyqt/location/placemanager.py
                                                            class PlaceManager(core.Object):
                                                                """An interface allowing clients to access places stored in a particular backend."""
                                                            
                                                                on_finished = core.Signal(location.PlaceSearchReply)
                                                            
                                                                def __init__(self, item: location.QPlaceManager):
                                                                    super().__init__()
                                                                    self.item = item
                                                                    self.finished.connect(self._on_finished)
                                                            
                                                                def __getattr__(self, val):
                                                                    return getattr(self.item, val)
                                                            
                                                                def _on_finished(self, reply: location.QPlaceReply):
                                                                    if isinstance(reply, location.QPlaceSearchReply):
                                                                        search_reply = location.PlaceSearchReply.clone_from(reply)
                                                                        self.on_finished.emit(search_reply)
                                                            
                                                                def get_category(self, cat_id: str) -> location.PlaceCategory:
                                                                    return location.PlaceCategory(self.item.category(cat_id))
                                                            
                                                                def get_child_categories(self, cat_id: str) -> list[location.PlaceCategory]:
                                                                    return [location.PlaceCategory(i) for i in self.item.childCategories(cat_id)]
                                                            
                                                                def get_locales(self) -> list[core.Locale]:
                                                                    return [core.Locale(i) for i in self.locales()]
                                                            
                                                                def search_place(
                                                                    self,
                                                                    search_term: str,
                                                                    coord: tuple[float, float] | positioning.QGeoCoordinate,
                                                                    radius: float | None = None,
                                                                    limit: int | None = None,
                                                                    relevance: location.placesearchrequest.RelevanceHintStr | None = None,
                                                                    categories: Sequence[location.QPlaceCategory] | None = None,
                                                                ):
                                                                    request = location.PlaceSearchRequest()
                                                                    request.setSearchTerm(search_term)
                                                                    if radius is None:
                                                                        radius = -1
                                                                    if isinstance(coord, tuple):
                                                                        coord = positioning.GeoCoordinate(*coord)
                                                                    circle = positioning.GeoCircle(coord, radius)
                                                                    request.setSearchArea(circle)
                                                                    if limit is not None:
                                                                        request.setLimit(limit)
                                                                    if relevance is not None:
                                                                        request.set_relevance_hint(relevance)
                                                                    if categories is not None:
                                                                        request.setCategories(categories)
                                                                    return self.search(request)
                                                            

                                                            PlaceMatchReply

                                                            Bases: PlaceReplyMixin, QPlaceMatchReply

                                                            Manages a place matching operation started by an instance of QPlaceManager.

                                                            Source code in prettyqt/location/placematchreply.py
                                                            class PlaceMatchReply(location.PlaceReplyMixin, location.QPlaceMatchReply):
                                                                """Manages a place matching operation started by an instance of QPlaceManager."""
                                                            
                                                                def __iter__(self) -> Iterator[location.Place]:
                                                                    return iter(self.get_places())
                                                            
                                                                def __getitem__(self, index: int) -> location.Place:
                                                                    return self.get_places()[index]
                                                            
                                                                def __len__(self):
                                                                    return len(self.get_places())
                                                            
                                                                @classmethod
                                                                def clone_from(cls, obj: location.QPlaceMatchReply) -> Self:
                                                                    reply = cls(obj.parent())
                                                                    reply.setPlaces([location.Place(i) for i in obj.places()])
                                                                    request = location.PlaceMatchRequest(obj.request())
                                                                    reply.setRequest(request)
                                                                    return reply
                                                            
                                                                def get_places(self) -> list[location.Place]:
                                                                    return [location.Place(i) for i in self.places()]
                                                            
                                                                def get_request(self) -> location.PlaceMatchRequest:
                                                                    return location.PlaceMatchRequest(self.request())
                                                            

                                                            PlaceProposedSearchResult

                                                            Bases: PlaceSearchResultMixin, QPlaceProposedSearchResult

                                                            Represents a search result containing a proposed search.

                                                            Source code in prettyqt/location/placeproposedsearchresult.py
                                                            4
                                                            5
                                                            6
                                                            7
                                                            class PlaceProposedSearchResult(
                                                                location.PlaceSearchResultMixin, location.QPlaceProposedSearchResult
                                                            ):
                                                                """Represents a search result containing a proposed search."""
                                                            

                                                            PlaceRatings

                                                            Bases: QPlaceRatings

                                                            Holds rating information about a place.

                                                            Source code in prettyqt/location/placeratings.py
                                                            class PlaceRatings(QtLocation.QPlaceRatings):
                                                                """Holds rating information about a place."""
                                                            
                                                                def __bool__(self):
                                                                    return not self.isEmpty()
                                                            
                                                                def __float__(self):
                                                                    return self.average()
                                                            

                                                            PlaceReplyMixin

                                                            Bases: ObjectMixin, _PlaceReplyBase

                                                            Source code in prettyqt/location/placereply.py
                                                            class PlaceReplyMixin(core.ObjectMixin, _PlaceReplyBase):
                                                                def get_error(self) -> ErrorStr:
                                                                    """Return error type.
                                                            
                                                                    Returns:
                                                                        Error type
                                                                    """
                                                                    return ERROR.inverse[self.error()]
                                                            
                                                                def get_type(self) -> TypeStr:
                                                                    """Return type.
                                                            
                                                                    Returns:
                                                                        Type
                                                                    """
                                                                    return TYPE.inverse[self.type()]
                                                            

                                                            get_error() -> ErrorStr

                                                            Return error type.

                                                            Source code in prettyqt/location/placereply.py
                                                            def get_error(self) -> ErrorStr:
                                                                """Return error type.
                                                            
                                                                Returns:
                                                                    Error type
                                                                """
                                                                return ERROR.inverse[self.error()]
                                                            

                                                            get_type() -> TypeStr

                                                            Return type.

                                                            Source code in prettyqt/location/placereply.py
                                                            def get_type(self) -> TypeStr:
                                                                """Return type.
                                                            
                                                                Returns:
                                                                    Type
                                                                """
                                                                return TYPE.inverse[self.type()]
                                                            

                                                            PlaceResult

                                                            Bases: PlaceSearchResultMixin, QPlaceResult

                                                            Represents a search result containing a place.

                                                            Source code in prettyqt/location/placeresult.py
                                                            4
                                                            5
                                                            6
                                                            7
                                                            8
                                                            class PlaceResult(location.PlaceSearchResultMixin, location.QPlaceResult):
                                                                """Represents a search result containing a place."""
                                                            
                                                                def get_place(self) -> location.Place:
                                                                    return location.Place(self.place())
                                                            

                                                            PlaceSearchReply

                                                            Bases: PlaceReplyMixin, QPlaceSearchReply

                                                            Manages a place search operation started by an instance of QPlaceManager.

                                                            Source code in prettyqt/location/placesearchreply.py
                                                            class PlaceSearchReply(location.PlaceReplyMixin, location.QPlaceSearchReply):
                                                                """Manages a place search operation started by an instance of QPlaceManager."""
                                                            
                                                                def __iter__(self) -> Iterator[location.PlaceSearchResult]:
                                                                    return iter(self.get_results())
                                                            
                                                                def __getitem__(self, index: int) -> location.PlaceSearchResult:
                                                                    return self.get_results()[index]
                                                            
                                                                def __len__(self):
                                                                    return len(self.get_results())
                                                            
                                                                @classmethod
                                                                def clone_from(cls, obj: location.QPlaceSearchReply) -> Self:
                                                                    reply = cls(obj.parent())
                                                                    reply.setResults([location.PlaceSearchResult(i) for i in obj.results()])
                                                                    request = location.PlaceSearchRequest(obj.nextPageRequest())
                                                                    reply.setNextPageRequest(request)
                                                                    request = location.PlaceSearchRequest(obj.previousPageRequest())
                                                                    reply.setPreviousPageRequest(request)
                                                                    request = location.PlaceSearchRequest(obj.request())
                                                                    reply.setRequest(request)
                                                                    return reply
                                                            
                                                                def get_results(self) -> list[location.PlaceSearchResult]:
                                                                    return [location.PlaceSearchResult(i) for i in self.results()]
                                                            
                                                                def get_next_page_request(self) -> location.PlaceSearchRequest:
                                                                    return location.PlaceSearchRequest(self.nextPageRequest())
                                                            
                                                                def get_previous_page_request(self) -> location.PlaceSearchRequest:
                                                                    return location.PlaceSearchRequest(self.previousPageRequest())
                                                            
                                                                def get_request(self) -> location.PlaceSearchRequest:
                                                                    return location.PlaceSearchRequest(self.request())
                                                            

                                                            PlaceSearchRequest

                                                            Bases: QPlaceSearchRequest

                                                            Represents the set of parameters for a search request.

                                                            Source code in prettyqt/location/placesearchrequest.py
                                                            class PlaceSearchRequest(location.QPlaceSearchRequest):
                                                                """Represents the set of parameters for a search request."""
                                                            
                                                                def get_visibility_scope(self) -> list[location.VisibilityStr]:
                                                                    """Return the scope of the visibility.
                                                            
                                                                    Returns:
                                                                        Visibility scope
                                                                    """
                                                                    return location.VISIBILITY.get_list(self.visibilityScope())
                                                            
                                                                def get_categories(self) -> list[location.PlaceCategory]:
                                                                    return [location.PlaceCategory(i) for i in self.categories()]
                                                            
                                                                def get_search_area(self) -> positioning.QGeoShape:
                                                                    area = self.searchArea()
                                                                    match area:
                                                                        case positioning.QGeoCircle():
                                                                            return positioning.GeoCircle(area)
                                                                        case positioning.QGeoPath():
                                                                            return positioning.GeoPath(area)
                                                                        case positioning.QGeoPolygon():
                                                                            return positioning.GeoPolygon(area)
                                                                        case positioning.QGeoRectangle():
                                                                            return positioning.GeoRectangle(area)
                                                                        case _:
                                                                            return positioning.GeoShape(area)
                                                            
                                                                def set_relevance_hint(
                                                                    self, hint: RelevanceHintStr | location.QPlaceSearchRequest.RelevanceHint
                                                                ):
                                                                    """Set the relevance hint.
                                                            
                                                                    Args:
                                                                        hint: Relevance hint
                                                                    """
                                                                    self.setRelevanceHint(RELEVANCE_HINT.get_enum_value(hint))
                                                            
                                                                def get_relevance_hint(self) -> RelevanceHintStr:
                                                                    """Return current relevance hint.
                                                            
                                                                    Returns:
                                                                        Relevance hint
                                                                    """
                                                                    return RELEVANCE_HINT.inverse[self.relevanceHint()]
                                                            

                                                            get_relevance_hint() -> RelevanceHintStr

                                                            Return current relevance hint.

                                                            Source code in prettyqt/location/placesearchrequest.py
                                                            def get_relevance_hint(self) -> RelevanceHintStr:
                                                                """Return current relevance hint.
                                                            
                                                                Returns:
                                                                    Relevance hint
                                                                """
                                                                return RELEVANCE_HINT.inverse[self.relevanceHint()]
                                                            

                                                            get_visibility_scope() -> list[location.VisibilityStr]

                                                            Return the scope of the visibility.

                                                            Source code in prettyqt/location/placesearchrequest.py
                                                            def get_visibility_scope(self) -> list[location.VisibilityStr]:
                                                                """Return the scope of the visibility.
                                                            
                                                                Returns:
                                                                    Visibility scope
                                                                """
                                                                return location.VISIBILITY.get_list(self.visibilityScope())
                                                            

                                                            set_relevance_hint(hint: RelevanceHintStr | location.QPlaceSearchRequest.RelevanceHint)

                                                            Set the relevance hint.

                                                            Parameters:

                                                            Name Type Description Default
                                                            hint RelevanceHintStr | RelevanceHint

                                                            Relevance hint

                                                            required
                                                            Source code in prettyqt/location/placesearchrequest.py
                                                            def set_relevance_hint(
                                                                self, hint: RelevanceHintStr | location.QPlaceSearchRequest.RelevanceHint
                                                            ):
                                                                """Set the relevance hint.
                                                            
                                                                Args:
                                                                    hint: Relevance hint
                                                                """
                                                                self.setRelevanceHint(RELEVANCE_HINT.get_enum_value(hint))
                                                            

                                                            PlaceSearchResult

                                                            Bases: PlaceSearchResultMixin, QPlaceSearchResult

                                                            The base class for search results.

                                                            Source code in prettyqt/location/placesearchresult.py
                                                            class PlaceSearchResult(PlaceSearchResultMixin, location.QPlaceSearchResult):
                                                                """The base class for search results."""
                                                            

                                                            PlaceSearchResultMixin

                                                            Bases: _PlaceSearchResultBase

                                                            Source code in prettyqt/location/placesearchresult.py
                                                            class PlaceSearchResultMixin(_PlaceSearchResultBase):
                                                                def get_icon(self) -> location.PlaceIcon | None:
                                                                    icon = self.icon()
                                                                    return None if icon.isEmpty() else location.PlaceIcon(icon)
                                                            
                                                                def get_type(self) -> TypeStr:
                                                                    """Return result type.
                                                            
                                                                    Returns:
                                                                        Result type
                                                                    """
                                                                    return TYPE.inverse[self.type()]
                                                            

                                                            get_type() -> TypeStr

                                                            Return result type.

                                                            Source code in prettyqt/location/placesearchresult.py
                                                            def get_type(self) -> TypeStr:
                                                                """Return result type.
                                                            
                                                                Returns:
                                                                    Result type
                                                                """
                                                                return TYPE.inverse[self.type()]
                                                            

                                                            PlaceUser

                                                            Bases: QPlaceUser

                                                            Represents an individual user.

                                                            Source code in prettyqt/location/placeuser.py
                                                            4
                                                            5
                                                            6
                                                            7
                                                            8
                                                            class PlaceUser(QtLocation.QPlaceUser):
                                                                """Represents an individual user."""
                                                            
                                                                def __str__(self):
                                                                    return self.name()