PlaceManager
Qt Base Class: QObject
Signature: QObject(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None
Base classes
Name |
Children |
Inherits |
Object prettyqt.core.object
|
|
|
⋔ Inheritance diagram
graph TD
1473573239424["location.PlaceManager"]
1473299782816["core.Object"]
1473299815024["core.ObjectMixin"]
140713234304496["builtins.object"]
1473288842240["QtCore.QObject"]
1473291690208["Shiboken.Object"]
1473299782816 --> 1473573239424
1473299815024 --> 1473299782816
140713234304496 --> 1473299815024
1473288842240 --> 1473299782816
1473291690208 --> 1473288842240
140713234304496 --> 1473291690208
🛈 DocStrings
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.QPlaceSearchReply):
reply = location.PlaceSearchReply.clone_from(reply)
self.on_finished.emit(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: list[str] | 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:
self.setCategories(categories)
return self.search(request)
|
⌗ Property table
Qt Property |
Type |
Doc |
objectName |
QString |
|