![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtLocation More...
#include <qplace.h>
Public Member Functions | |
QPlace () | |
Constructs an empty place object. | |
QPlace (const QPlace &other) noexcept | |
Constructs a copy of other. | |
QPlace (QPlace &&other) noexcept=default | |
~QPlace () | |
Destroys this place. | |
QPlace & | operator= (const QPlace &other) noexcept |
Assigns other to this place and returns a reference to this place. | |
void | swap (QPlace &other) noexcept |
QList< QPlaceCategory > | categories () const |
Returns categories that this place belongs to. | |
void | setCategory (const QPlaceCategory &category) |
Sets a single category that this place belongs to. | |
void | setCategories (const QList< QPlaceCategory > &categories) |
Sets the categories that this place belongs to. | |
QGeoLocation | location () const |
Returns the location of the place. | |
void | setLocation (const QGeoLocation &location) |
Sets the location of the place. | |
QPlaceRatings | ratings () const |
Returns an aggregated rating of the place. | |
void | setRatings (const QPlaceRatings &ratings) |
Sets the aggregated rating of the place. | |
QPlaceSupplier | supplier () const |
Returns the supplier of this place. | |
void | setSupplier (const QPlaceSupplier &supplier) |
Sets the supplier of this place to supplier. | |
QString | attribution () const |
Returns a rich text attribution string of the place. | |
void | setAttribution (const QString &attribution) |
Sets the attribution string of the place. | |
QPlaceIcon | icon () const |
Returns the icon of the place. | |
void | setIcon (const QPlaceIcon &icon) |
Sets the icon of the place. | |
QPlaceContent::Collection | content (QPlaceContent::Type type) const |
Returns a collection of content associated with a place. | |
void | setContent (QPlaceContent::Type type, const QPlaceContent::Collection &content) |
Sets a collection of content for the given type. | |
void | insertContent (QPlaceContent::Type type, const QPlaceContent::Collection &content) |
Adds a collection of content of the given type to the place. | |
int | totalContentCount (QPlaceContent::Type type) const |
Returns the total count of content objects of the given type. | |
void | setTotalContentCount (QPlaceContent::Type type, int total) |
Sets the totalCount of content objects of the given type. | |
QString | name () const |
Returns the name of the place. | |
void | setName (const QString &name) |
Sets the name of the place. | |
QString | placeId () const |
Returns the identifier of the place. | |
void | setPlaceId (const QString &identifier) |
Sets the identifier of the place. | |
QString | primaryPhone () const |
Returns the primary phone number for this place. | |
QString | primaryFax () const |
Returns the primary fax number for this place. | |
QString | primaryEmail () const |
Returns the primary email address for this place. | |
QUrl | primaryWebsite () const |
Returns the primary website of the place. | |
bool | detailsFetched () const |
Returns true if the details of this place have been fetched, otherwise returns false. | |
void | setDetailsFetched (bool fetched) |
Sets whether the details of this place have been fetched or not. | |
QStringList | extendedAttributeTypes () const |
Returns the types of extended attributes that this place has. | |
QPlaceAttribute | extendedAttribute (const QString &attributeType) const |
Returns the exteded attribute corresponding to the specified attributeType. | |
void | setExtendedAttribute (const QString &attributeType, const QPlaceAttribute &attribute) |
Assigns an attribute of the given attributeType to a place. | |
void | removeExtendedAttribute (const QString &attributeType) |
Remove the attribute of attributeType from the place. | |
QStringList | contactTypes () const |
Returns the type of contact details this place has. | |
QList< QPlaceContactDetail > | contactDetails (const QString &contactType) const |
Returns a list of contact details of the specified contactType. | |
void | setContactDetails (const QString &contactType, QList< QPlaceContactDetail > details) |
Sets the contact details of a specified contactType. | |
void | appendContactDetail (const QString &contactType, const QPlaceContactDetail &detail) |
Appends a contact detail of a specified contactType. | |
void | removeContactDetails (const QString &contactType) |
Removes all the contact details of a given contactType. | |
QLocation::Visibility | visibility () const |
Returns the visibility of the place. | |
void | setVisibility (QLocation::Visibility visibility) |
Sets the visibility of the place to visibility. | |
bool | isEmpty () const |
Returns a boolean indicating whether the all the fields of the place are empty or not. | |
Protected Member Functions | |
QPlace (const QSharedDataPointer< QPlacePrivate > &dd) | |
Constructs an place object using dd as private implementation. | |
Friends | |
class | QDeclarativePlace |
bool | operator== (const QPlace &lhs, const QPlace &rhs) noexcept |
Returns true if lhs is equal to rhs, otherwise returns false. | |
bool | operator!= (const QPlace &lhs, const QPlace &rhs) noexcept |
Returns true if lhs is not equal to rhs, otherwise returns false. | |
\inmodule QtLocation
The QPlace class represents a set of data about a place.
\input place-definition.qdocinc
QPlace::QPlace | ( | ) |
Constructs an empty place object.
Definition at line 95 of file qplace.cpp.
|
defaultnoexcept |
Constructs a copy of other.
|
defaultnoexcept |
|
default |
Destroys this place.
|
protected |
Constructs an place object using dd as private implementation.
Definition at line 103 of file qplace.cpp.
void QPlace::appendContactDetail | ( | const QString & | contactType, |
const QPlaceContactDetail & | detail | ||
) |
Appends a contact detail of a specified contactType.
See QPlaceContactDetail for a list of common \l {QPlaceContactDetail::Email}{contact types}.
Definition at line 508 of file qplace.cpp.
References QList< T >::append(), QPlacePrivate::contacts(), QMap< Key, T >::insert(), and QMap< Key, T >::value().
QString QPlace::attribution | ( | ) | const |
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.
Definition at line 323 of file qplace.cpp.
References QPlacePrivate::attribution().
Referenced by QDeclarativePlace::attribution(), QDeclarativePlace::setAttribution(), setAttribution(), and QDeclarativePlace::setPlace().
QList< QPlaceCategory > QPlace::categories | ( | ) | const |
Returns categories that this place belongs to.
Definition at line 164 of file qplace.cpp.
References QPlacePrivate::categories().
Referenced by QDeclarativePlace::setPlace().
QList< QPlaceContactDetail > QPlace::contactDetails | ( | const QString & | contactType | ) | const |
Returns a list of contact details of the specified contactType.
See QPlaceContactDetail for a list of common \l {QPlaceContactDetail::Email}{contact types}.
Definition at line 482 of file qplace.cpp.
References QPlacePrivate::contacts(), and QMap< Key, T >::value().
Referenced by RequestHandler::phoneNumbers().
QStringList QPlace::contactTypes | ( | ) | const |
Returns the type of contact details this place has.
See QPlaceContactDetail for a list of common \l {QPlaceContactDetail::Email}{contact types}.
Definition at line 472 of file qplace.cpp.
References QPlacePrivate::contacts(), and QMap< Key, T >::keys().
Referenced by RequestHandler::phoneNumbers().
QPlaceContent::Collection QPlace::content | ( | QPlaceContent::Type | type | ) | const |
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 type specifies which kind of content is to be retrieved.
Definition at line 241 of file qplace.cpp.
References QPlacePrivate::m_contentCollections.
Referenced by insertContent(), setContent(), and QDeclarativePlace::setPlace().
bool QPlace::detailsFetched | ( | ) | const |
Returns true if the details of this place have been fetched, otherwise returns false.
Definition at line 410 of file qplace.cpp.
References QPlacePrivate::detailsFetched().
Referenced by RequestHandler::details(), QDeclarativePlace::detailsFetched(), and QDeclarativePlace::setPlace().
QPlaceAttribute QPlace::extendedAttribute | ( | const QString & | attributeType | ) | const |
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.
Definition at line 436 of file qplace.cpp.
References QPlacePrivate::extendedAttribute().
Referenced by RequestHandler::openingHours().
QStringList QPlace::extendedAttributeTypes | ( | ) | const |
Returns the types of extended attributes that this place has.
Definition at line 426 of file qplace.cpp.
References QPlacePrivate::extendedAttributes(), and QMap< Key, T >::keys().
Referenced by RequestHandler::openingHours().
QPlaceIcon QPlace::icon | ( | ) | const |
Returns the icon of the place.
Definition at line 339 of file qplace.cpp.
References QPlacePrivate::icon().
Referenced by RequestHandler::icon(), QDeclarativePlace::icon(), QDeclarativePlace::setIcon(), setIcon(), and QDeclarativePlace::setPlace().
void QPlace::insertContent | ( | QPlaceContent::Type | type, |
const QPlaceContent::Collection & | content | ||
) |
Adds a collection of content of the given type to the place.
Any index in content that already exists is overwritten.
Definition at line 258 of file qplace.cpp.
References QMap< Key, T >::cbegin(), QMap< Key, T >::cend(), content(), iter, and QPlacePrivate::m_contentCollections.
Referenced by RequestHandler::contentHandler(), and RequestHandler::handleImagesReply().
bool QPlace::isEmpty | ( | ) | const |
Returns a boolean indicating whether the all the fields of the place are empty or not.
Definition at line 548 of file qplace.cpp.
References QPlacePrivate::isEmpty().
QGeoLocation QPlace::location | ( | ) | const |
Returns the location of the place.
Definition at line 189 of file qplace.cpp.
References QPlacePrivate::location().
Referenced by RequestHandler::convertSearchResult(), RequestHandler::handleSearchReply(), and QDeclarativePlace::setPlace().
QString QPlace::name | ( | ) | const |
Returns the name of the place.
Definition at line 288 of file qplace.cpp.
References QPlacePrivate::name().
Referenced by RequestHandler::convertSearchResult(), RequestHandler::handleSearchReply(), RequestHandler::matchHandler(), QDeclarativePlace::name(), QT_BEGIN_NAMESPACE::parsePlaceResult(), QDeclarativePlace::setName(), and QDeclarativePlace::setPlace().
Assigns other to this place and returns a reference to this place.
Definition at line 122 of file qplace.cpp.
References other().
QString QPlace::placeId | ( | ) | const |
Returns the identifier of the place.
The place identifier is only meaningful to the QPlaceManager that 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.
Definition at line 306 of file qplace.cpp.
References QPlacePrivate::placeId().
Referenced by RequestHandler::content(), RequestHandler::details(), QDeclarativePlaceContentModel::fetchMore(), RequestHandler::images(), QDeclarativePlace::placeId(), RequestHandler::removeCategory(), RequestHandler::removePlace(), QDeclarativePlace::setPlace(), and QDeclarativePlace::setPlaceId().
QString QPlace::primaryEmail | ( | ) | const |
Returns the primary email address for this place.
This convenience function accesses the first contact detail of the \l {QPlaceContactDetail::Email}{email type}. If no email addresses exist, then an empty string is returned.
Definition at line 383 of file qplace.cpp.
References QList< T >::at(), QPlacePrivate::contacts(), QPlaceContactDetail::Email, QList< T >::isEmpty(), and QMap< Key, T >::value().
Referenced by QDeclarativePlace::setPlace().
QString QPlace::primaryFax | ( | ) | const |
Returns the primary fax number for this place.
This convenience function accesses the first contact detail of the \l {QPlaceContactDetail::Fax}{fax type}. If no fax details exist, then an empty string is returned.
Definition at line 369 of file qplace.cpp.
References QList< T >::at(), QPlacePrivate::contacts(), QPlaceContactDetail::Fax, QList< T >::isEmpty(), and QMap< Key, T >::value().
Referenced by QDeclarativePlace::setPlace().
QString QPlace::primaryPhone | ( | ) | const |
Returns the primary phone number for this place.
This accesses the first contact detail of the \l {QPlaceContactDetail::Phone}{phone number type}. If no phone details exist, then an empty string is returned.
Definition at line 356 of file qplace.cpp.
References QList< T >::at(), QPlacePrivate::contacts(), QList< T >::isEmpty(), QPlaceContactDetail::Phone, and QMap< Key, T >::value().
Referenced by QDeclarativePlace::setPlace().
QUrl QPlace::primaryWebsite | ( | ) | const |
Returns the primary website of the place.
This convenience function accesses the first contact detail of the \l {QPlaceContactDetail::Website}{website type}. If no websites exist, then an empty string is returned.
Definition at line 397 of file qplace.cpp.
References QList< T >::at(), QPlacePrivate::contacts(), QList< T >::isEmpty(), QMap< Key, T >::value(), and QPlaceContactDetail::Website.
Referenced by QDeclarativePlace::setPlace().
QPlaceRatings QPlace::ratings | ( | ) | const |
Returns an aggregated rating of the place.
Definition at line 205 of file qplace.cpp.
References QPlacePrivate::ratings().
Referenced by RequestHandler::ratings(), QDeclarativePlace::ratings(), QDeclarativePlace::setPlace(), and QDeclarativePlace::setRatings().
Removes all the contact details of a given contactType.
The contactType is no longer returned when QPlace::contactTypes() is called.
Definition at line 520 of file qplace.cpp.
References QPlacePrivate::contacts(), and QMap< Key, T >::remove().
Remove the attribute of attributeType from the place.
The attribute will no longer be listed by QPlace::extendedAttributeTypes()
Definition at line 462 of file qplace.cpp.
References setExtendedAttribute().
Sets the attribution string of the place.
Definition at line 331 of file qplace.cpp.
References attribution(), and QPlacePrivate::setAttribution().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult(), and QDeclarativePlace::setAttribution().
void QPlace::setCategories | ( | const QList< QPlaceCategory > & | categories | ) |
Sets the categories that this place belongs to.
Definition at line 181 of file qplace.cpp.
References QPlacePrivate::setCategories().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult().
void QPlace::setCategory | ( | const QPlaceCategory & | category | ) |
Sets a single category that this place belongs to.
Definition at line 172 of file qplace.cpp.
References category(), and QPlacePrivate::setCategories().
void QPlace::setContactDetails | ( | const QString & | contactType, |
QList< QPlaceContactDetail > | details | ||
) |
Sets the contact details of a specified contactType.
If details is empty, then the contactType is removed from the place such that it is no longer returned by QPlace::contactTypes().
See QPlaceContactDetail for a list of common \l {QPlaceContactDetail::Email}{contact types}.
Definition at line 495 of file qplace.cpp.
References QPlacePrivate::contacts(), QMap< Key, T >::insert(), QList< T >::isEmpty(), and QMap< Key, T >::remove().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult().
void QPlace::setContent | ( | QPlaceContent::Type | type, |
const QPlaceContent::Collection & | content | ||
) |
Sets a collection of content for the given type.
Definition at line 249 of file qplace.cpp.
References content(), and QPlacePrivate::m_contentCollections.
void QPlace::setDetailsFetched | ( | bool | fetched | ) |
Sets whether the details of this place have been fetched or not.
Definition at line 418 of file qplace.cpp.
References QPlacePrivate::setDetailsFetched().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult().
void QPlace::setExtendedAttribute | ( | const QString & | attributeType, |
const QPlaceAttribute & | attribute | ||
) |
Assigns an attribute of the given attributeType to a place.
If the given attributeType already exists in the place, then it is overwritten.
If attribute is a default constructed QPlaceAttribute, then the attributeType is removed from the place which means it will not be listed by QPlace::extendedAttributeTypes().
Definition at line 448 of file qplace.cpp.
References QPlacePrivate::extendedAttributes(), QMap< Key, T >::insert(), and QMap< Key, T >::remove().
Referenced by removeExtendedAttribute().
void QPlace::setIcon | ( | const QPlaceIcon & | icon | ) |
Sets the icon of the place.
Definition at line 347 of file qplace.cpp.
References icon(), and QPlacePrivate::setIcon().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult(), and QDeclarativePlace::setIcon().
void QPlace::setLocation | ( | const QGeoLocation & | location | ) |
Sets the location of the place.
Definition at line 197 of file qplace.cpp.
References QPlacePrivate::setLocation().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult(), and RequestHandler::savePlace().
Sets the name of the place.
Definition at line 296 of file qplace.cpp.
References QPlacePrivate::setName().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult(), RequestHandler::savePlace(), and QDeclarativePlace::setName().
Sets the identifier of the place.
Definition at line 314 of file qplace.cpp.
References QPlacePrivate::setPlaceId().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult(), and QDeclarativePlace::setPlaceId().
void QPlace::setRatings | ( | const QPlaceRatings & | ratings | ) |
Sets the aggregated rating of the place.
Definition at line 213 of file qplace.cpp.
References QPlacePrivate::setRatings().
Referenced by QDeclarativePlace::setRatings().
void QPlace::setSupplier | ( | const QPlaceSupplier & | supplier | ) |
Sets the supplier of this place to supplier.
Definition at line 229 of file qplace.cpp.
References QPlacePrivate::setSupplier(), and supplier().
Referenced by QDeclarativePlace::setSupplier().
void QPlace::setTotalContentCount | ( | QPlaceContent::Type | type, |
int | total | ||
) |
Sets the totalCount of content objects of the given type.
Definition at line 280 of file qplace.cpp.
References QMap< Key, T >::insert(), and QPlacePrivate::m_contentCounts.
Referenced by RequestHandler::handleImagesReply().
void QPlace::setVisibility | ( | QLocation::Visibility | visibility | ) |
Sets the visibility of the place to visibility.
Definition at line 528 of file qplace.cpp.
References QPlacePrivate::setVisibility(), and visibility().
Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult(), and QDeclarativePlace::setVisibility().
QPlaceSupplier QPlace::supplier | ( | ) | const |
Returns the supplier of this place.
Definition at line 221 of file qplace.cpp.
References QPlacePrivate::supplier().
Referenced by QDeclarativePlace::setPlace(), QDeclarativePlace::setSupplier(), setSupplier(), and QDeclarativePlace::supplier().
int QPlace::totalContentCount | ( | QPlaceContent::Type | type | ) | const |
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.
Definition at line 272 of file qplace.cpp.
References QPlacePrivate::m_contentCounts, and QMap< Key, T >::value().
Referenced by QDeclarativePlace::setPlace().
QLocation::Visibility QPlace::visibility | ( | ) | const |
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.
Definition at line 540 of file qplace.cpp.
References QPlacePrivate::visibility().
Referenced by setVisibility(), QDeclarativePlace::setVisibility(), and QDeclarativePlace::visibility().
|
friend |