Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPlace Class Reference

\inmodule QtLocation More...

#include <qplace.h>

+ Collaboration diagram for QPlace:

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.
 
QPlaceoperator= (const QPlace &other) noexcept
 Assigns other to this place and returns a reference to this place.
 
void swap (QPlace &other) noexcept
 
QList< QPlaceCategorycategories () 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< QPlaceContactDetailcontactDetails (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.
 

Detailed Description

\inmodule QtLocation

Since
5.6

The QPlace class represents a set of data about a place.

\input place-definition.qdocinc

Definition at line 24 of file qplace.h.

Constructor & Destructor Documentation

◆ QPlace() [1/4]

QPlace::QPlace ( )

Constructs an empty place object.

Definition at line 95 of file qplace.cpp.

◆ QPlace() [2/4]

QPlace::QPlace ( const QPlace & other)
defaultnoexcept

Constructs a copy of other.

◆ QPlace() [3/4]

QPlace::QPlace ( QPlace && other)
defaultnoexcept

◆ ~QPlace()

QPlace::~QPlace ( )
default

Destroys this place.

◆ QPlace() [4/4]

QPlace::QPlace ( const QSharedDataPointer< QPlacePrivate > & dd)
protected

Constructs an place object using dd as private implementation.

Definition at line 103 of file qplace.cpp.

Member Function Documentation

◆ appendContactDetail()

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 QPlacePrivate::contacts().

+ Here is the call graph for this function:

◆ attribution()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ categories()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contactDetails()

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().

Referenced by RequestHandler::phoneNumbers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contactTypes()

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().

Referenced by RequestHandler::phoneNumbers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ content()

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().

+ Here is the caller graph for this function:

◆ detailsFetched()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extendedAttribute()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extendedAttributeTypes()

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().

Referenced by RequestHandler::openingHours().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ icon()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertContent()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEmpty()

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().

+ Here is the call graph for this function:

◆ location()

QGeoLocation QPlace::location ( ) const

Returns the location of the place.

Definition at line 189 of file qplace.cpp.

References QPlacePrivate::location().

Referenced by QDeclarativePlace::setPlace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ name()

QString QPlace::name ( ) const

Returns the name of the place.

Definition at line 288 of file qplace.cpp.

References QPlacePrivate::name().

Referenced by RequestHandler::matchHandler(), QDeclarativePlace::name(), QT_BEGIN_NAMESPACE::parsePlaceResult(), QDeclarativePlace::setName(), and QDeclarativePlace::setPlace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

QPlace & QPlace::operator= ( const QPlace & other)
noexcept

Assigns other to this place and returns a reference to this place.

Definition at line 122 of file qplace.cpp.

References other().

+ Here is the call graph for this function:

◆ placeId()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ primaryEmail()

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 QPlacePrivate::contacts(), and QPlaceContactDetail::Email.

Referenced by QDeclarativePlace::setPlace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ primaryFax()

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 QPlacePrivate::contacts(), and QPlaceContactDetail::Fax.

Referenced by QDeclarativePlace::setPlace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ primaryPhone()

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 QPlacePrivate::contacts(), and QPlaceContactDetail::Phone.

Referenced by QDeclarativePlace::setPlace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ primaryWebsite()

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 QPlacePrivate::contacts(), and QPlaceContactDetail::Website.

Referenced by QDeclarativePlace::setPlace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ratings()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeContactDetails()

void QPlace::removeContactDetails ( const QString & contactType)

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().

+ Here is the call graph for this function:

◆ removeExtendedAttribute()

void QPlace::removeExtendedAttribute ( const QString & attributeType)

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().

+ Here is the call graph for this function:

◆ setAttribution()

void QPlace::setAttribution ( const QString & attribution)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCategories()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCategory()

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().

+ Here is the call graph for this function:

◆ setContactDetails()

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().

Referenced by QT_BEGIN_NAMESPACE::parsePlaceResult().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContent()

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.

+ Here is the call graph for this function:

◆ setDetailsFetched()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setExtendedAttribute()

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().

Referenced by removeExtendedAttribute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIcon()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocation()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

void QPlace::setName ( const QString & name)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPlaceId()

void QPlace::setPlaceId ( const QString & identifier)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRatings()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSupplier()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTotalContentCount()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setVisibility()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ supplier()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swap()

void QPlace::swap ( QPlace & other)
inlinenoexcept

Definition at line 35 of file qplace.h.

References other().

+ Here is the call graph for this function:

◆ totalContentCount()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ visibility()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QPlace::operator!= ( const QPlace & lhs,
const QPlace & rhs )
friend

Returns true if lhs is not equal to rhs, otherwise returns false.

Definition at line 39 of file qplace.h.

◆ operator==

bool QPlace::operator== ( const QPlace & lhs,
const QPlace & rhs )
friend

Returns true if lhs is equal to rhs, otherwise returns false.

Definition at line 37 of file qplace.h.

◆ QDeclarativePlace

friend class QDeclarativePlace
friend

Definition at line 104 of file qplace.h.


The documentation for this class was generated from the following files: