PySide6.QtLocation.QPlace¶
- class QPlace¶
- The - QPlaceclass represents a set of data about a place. More…- Synopsis¶- Methods¶- def - __init__()
- def - attribution()
- def - categories()
- def - contactDetails()
- def - contactTypes()
- def - content()
- def - detailsFetched()
- def - icon()
- def - insertContent()
- def - isEmpty()
- def - location()
- def - name()
- def - __ne__()
- def - __eq__()
- def - placeId()
- def - primaryEmail()
- def - primaryFax()
- def - primaryPhone()
- def - primaryWebsite()
- def - ratings()
- def - setAttribution()
- def - setCategories()
- def - setCategory()
- def - setContent()
- def - setIcon()
- def - setLocation()
- def - setName()
- def - setPlaceId()
- def - setRatings()
- def - setSupplier()
- def - setVisibility()
- def - supplier()
- def - swap()
- def - visibility()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- Warning - This section contains snippets that were automatically translated from C++ to Python and may contain errors. - A place is a point of interest, it could be a favorite restaurant, a park or someone’s home. A - QPlaceobject represents a place by acting as a container for various information about that place.- This information can be divided into 2 broad classifications - Details 
- Rich content 
 - The place details consist of properties of the place, such as the name, location, contact information and so on. When a place is returned during a search, these details are filled in. Sometimes in order to save bandwidth, there are further details about the place that can be retrieved on an individual place by place basis, if the user is interested. The - detailsFetched()function can be queried to see if all available details have been fetched, and if not,- getPlaceDetails()can be used to retrieve them. Precisely which details are populated during a search and which need to be fetched individually may vary from provider to provider. See plugin documentation for more details.- The rich content of a place consists of items such as images, reviews and editorials. Potentially there may be many rich content items, so they are treated separately from the place details. They can be retrieved in a paged fashion via - getPlaceContent(). If necessary, the content may be assigned to a place so it can act as a convenient container.- Contact Information¶- The contact information of a place is based around a common set of - contact types. To retrieve all the phone numbers of a place, one would do:- if place.contactTypes().contains(QPlaceContactDetail.Phone): for number in place.contactDetails(QPlaceContactDetail.Phone): print(number.label(), ":", number.value()) - The contact types are string values by design to allow for providers to introduce new contact types. - For convenience there are a set of functions which return the value of the first contact detail of each type. - Extended Attributes¶- Places may have additional attributes which are not covered in the formal API. Similar to contacts attributes are based around a common set of - attribute types. To retrieve an extended attribute one would do:- if place.extendedAttributeTypes().contains(QPlaceAttribute.OpeningHours): print(place.extendedAttribute(QPlaceAttribute.OpeningHours).text()) - The attribute types are string values by design to allow providers to introduce new attribute types. - Content¶- The - QPlaceobject is only meant to be a convenient container to hold rich content such as images, reviews and so on. Retrieval of content should happen via- getPlaceContent().- The content is stored as a - Collectionwhich contains both the index of the content, as well as the content itself. This enables developers to check whether a particular item has already been retrieved and if not, then request that content.- Attribution¶- Places have a field for a rich text attribution string. Some providers may require that the attribution be shown when a place is displayed to a user. - Categories¶- Different categories may be assigned to a place to indicate that the place is associated with those categories. When saving a place, the only meaningful data is the category id, the rest of the category data is effectively ignored. The category must already exist before saving the place (it is not possible to create a new category, assign it to the place, save the place and expect the category to be created). - Saving Caveats¶- The Places API is currently designed for only saving - coredetails. Saving rich content like images and reviews or details like supplier and rating is not a supported use case. Typically a manager will generally ignore these fields upon save and may produce a warning message if they are populated.- The Places API only supports saving of the following core details: - name 
- place id 
- location 
- contact details 
- icon 
- categories (tag-like names to describe a place) 
- visibility scope 
 - It is possible that providers may only support a subset of these. See the plugin documentation for more details. - Saving of properties such as the rating, extended attributes, images, reviews, editorials and supplier is explicitly not supported by the Places API. - __init__()¶
 - Constructs an empty place object. - __init__(other)
- Parameters:
- other – - QPlace
 
 - Constructs a copy of - other.- appendContactDetail(contactType, detail)¶
- Parameters:
- contactType – str 
- detail – - QPlaceContactDetail
 
 
 - Appends a contact - detailof a specified- contactType.- See - QPlaceContactDetailfor a list of common contact types .- attribution()¶
- Return type:
- str 
 
 - Returns a rich text attribution string of the place. Note, some providers may have a requirement where the attribution must be shown whenever a place is displayed to an end user. - See also - categories()¶
- Return type:
- .list of QPlaceCategory 
 
 - Returns categories that this place belongs to. - See also - contactDetails(contactType)¶
- Parameters:
- contactType – str 
- Return type:
- .list of QPlaceContactDetail 
 
 - Returns a list of contact details of the specified - contactType.- See - QPlaceContactDetailfor a list of common contact types .- See also - contactTypes()¶
- Return type:
- list of strings 
 
 - Returns the type of contact details this place has. - See - QPlaceContactDetailfor a list of common contact types .- content(type)¶
- Parameters:
- type – - Type
- Return type:
- Dictionary with keys of type .int and values of type QPlaceContent. 
 
 - Returns a collection of content associated with a place. This collection is a map with the key being the index of the content object and value being the content object itself. - The - typespecifies which kind of content is to be retrieved.- See also - detailsFetched()¶
- Return type:
- bool 
 
 - Returns true if the details of this place have been fetched, otherwise returns false. - See also - extendedAttribute(attributeType)¶
- Parameters:
- attributeType – str 
- Return type:
 
 - Returns the exteded attribute corresponding to the specified - attributeType. If the place does not have that particular attribute type, a default constructed QPlaceExtendedAttribute is returned.- See also - extendedAttributeTypes()¶
- Return type:
- list of strings 
 
 - Returns the types of extended attributes that this place has. - icon()¶
- Return type:
 
 - Returns the icon of the place. - See also - insertContent(type, content)¶
- Parameters:
- type – - Type
- content – Dictionary with keys of type .int and values of type QPlaceContent. 
 
 
 - Adds a collection of - contentof the given- typeto the place. Any index in- contentthat already exists is overwritten.- isEmpty()¶
- Return type:
- bool 
 
 - Returns a boolean indicating whether the all the fields of the place are empty or not. - location()¶
- Return type:
 
 - Returns the location of the place. - See also - name()¶
- Return type:
- str 
 
 - Returns the name of the place. - See also - Returns true if - lhsis not equal to- rhs, otherwise returns false.- Returns true if - lhsis equal to- rhs, otherwise returns false.- placeId()¶
- Return type:
- str 
 
 - Returns the identifier of the place. The place identifier is only meaningful to the - QPlaceManagerthat generated it and is not transferable between managers. The place identifier is not guaranteed to be universally unique, but unique for the manager that generated it.- See also - primaryEmail()¶
- Return type:
- str 
 
 - Returns the primary email address for this place. This convenience function accesses the first contact detail of the email type . If no email addresses exist, then an empty string is returned. - primaryFax()¶
- Return type:
- str 
 
 - Returns the primary fax number for this place. This convenience function accesses the first contact detail of the fax type . If no fax details exist, then an empty string is returned. - primaryPhone()¶
- Return type:
- str 
 
 - Returns the primary phone number for this place. This accesses the first contact detail of the phone number type . If no phone details exist, then an empty string is returned. - Returns the primary website of the place. This convenience function accesses the first contact detail of the website type . If no websites exist, then an empty string is returned. - ratings()¶
- Return type:
 
 - Returns an aggregated rating of the place. - See also - removeContactDetails(contactType)¶
- Parameters:
- contactType – str 
 
 - Removes all the contact details of a given - contactType.- The - contactTypeis no longer returned when- contactTypes()is called.- removeExtendedAttribute(attributeType)¶
- Parameters:
- attributeType – str 
 
 - Remove the attribute of - attributeTypefrom the place.- The attribute will no longer be listed by - extendedAttributeTypes()- setAttribution(attribution)¶
- Parameters:
- attribution – str 
 
 - Sets the - attributionstring of the place.- See also - setCategories(categories)¶
- Parameters:
- categories – .list of QPlaceCategory 
 
 - Sets the - categoriesthat this place belongs to.- See also - setCategory(category)¶
- Parameters:
- category – - QPlaceCategory
 
 - Sets a single - categorythat this place belongs to.- setContactDetails(contactType, details)¶
- Parameters:
- contactType – str 
- details – .list of QPlaceContactDetail 
 
 
 - Sets the contact - detailsof a specified- contactType.- If - detailsis empty, then the- contactTypeis removed from the place such that it is no longer returned by- contactTypes().- See - QPlaceContactDetailfor a list of common contact types .- See also - setContent(type, content)¶
- Parameters:
- type – - Type
- content – Dictionary with keys of type .int and values of type QPlaceContent. 
 
 
 - Sets a collection of - contentfor the given- type.- See also - setDetailsFetched(fetched)¶
- Parameters:
- fetched – bool 
 
 - Sets whether the details of this place have been - fetchedor not.- See also - setExtendedAttribute(attributeType, attribute)¶
- Parameters:
- attributeType – str 
- attribute – - QPlaceAttribute
 
 
 - Assigns an - attributeof the given- attributeTypeto a place. If the given- attributeTypealready exists in the place, then it is overwritten.- If - attributeis a default constructed- QPlaceAttribute, then the- attributeTypeis removed from the place which means it will not be listed by- extendedAttributeTypes().- See also - setIcon(icon)¶
- Parameters:
- icon – - QPlaceIcon
 
 - Sets the - iconof the place.- See also - setLocation(location)¶
- Parameters:
- location – - QGeoLocation
 
 - Sets the - locationof the place.- See also - setName(name)¶
- Parameters:
- name – str 
 
 - Sets the - nameof the place.- See also - setPlaceId(identifier)¶
- Parameters:
- identifier – str 
 
 - Sets the - identifierof the place.- See also - setRatings(ratings)¶
- Parameters:
- ratings – - QPlaceRatings
 
 - Sets the aggregated - ratingof the place.- See also - setSupplier(supplier)¶
- Parameters:
- supplier – - QPlaceSupplier
 
 - Sets the supplier of this place to - supplier.- See also - Sets the - totalCountof content objects of the given- type.- See also - setVisibility(visibility)¶
- Parameters:
- visibility – - Visibility
 
 - Sets the visibility of the place to - visibility.- See also - supplier()¶
- Return type:
 
 - Returns the supplier of this place. - See also - Returns the total count of content objects of the given - type. This total count indicates how many the manager/provider should have available. (As opposed to how many objects this place instance is currently assigned).- A negative count indicates that the total number of items is unknown. By default the total content count is set to 0. - See also - visibility()¶
- Return type:
 
 - Returns the visibility of the place. - The default visibility of a new place is set to QtLocatin::Unspecified visibility. If a place is saved with unspecified visibility the backend chooses an appropriate default visibility to use when saving. - See also