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
qdeclarativeplace.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
7#include "error_messages_p.h"
8
9#include <QtCore/QCoreApplication>
10#include <QtCore/QMetaObject>
11#include <QtQml/QQmlEngine>
12#include <QtQml/QQmlInfo>
13#include <QtLocation/QGeoServiceProvider>
14#include <QtLocation/QPlaceAttribute>
15#include <QtLocation/QPlaceManager>
16#include <QtLocation/QPlaceDetailsReply>
17#include <QtLocation/QPlaceReply>
18#include <QtLocation/QPlaceIdReply>
19#include <QtLocation/QPlaceContactDetail>
20
22
151: QObject(parent),
152 m_extendedAttributes(new QQmlPropertyMap(this)),
153 m_contactDetails(new QDeclarativeContactDetails(this))
154{
156 this, &QDeclarativePlace::contactsModified);
157
158 setPlace(QPlace());
159}
160
162: QObject(parent),
163 m_extendedAttributes(new QQmlPropertyMap(this)),
164 m_contactDetails(new QDeclarativeContactDetails(this)),
165 m_plugin(plugin)
166{
168
170 this, &QDeclarativePlace::contactsModified);
171
172 setPlace(src);
173}
174
178
179// From QQmlParserStatus
181{
182 m_complete = true;
183}
184
191{
192 if (m_plugin == plugin)
193 return;
194
195 m_plugin = plugin;
196 if (m_complete)
198
199 if (m_plugin->isAttached()) {
200 pluginReady();
201 } else {
203 this, &QDeclarativePlace::pluginReady);
204 }
205}
206
207void QDeclarativePlace::pluginReady()
208{
209 QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
210 QPlaceManager *placeManager = serviceProvider->placeManager();
211 if (!placeManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
213 .arg(m_plugin->name()).arg(serviceProvider->errorString()));
214 return;
215 }
216}
217
219{
220 return m_plugin;
221}
222
229{
230 if (!m_reviewModel) {
231 m_reviewModel = new QDeclarativePlaceReviewModel(this);
232 m_reviewModel->setPlace(this);
233 }
234
235 return m_reviewModel;
236}
237
244{
245 if (!m_imageModel) {
246 m_imageModel = new QDeclarativePlaceImageModel(this);
247 m_imageModel->setPlace(this);
248 }
249
250 return m_imageModel;
251}
252
259{
260 if (!m_editorialModel) {
261 m_editorialModel = new QDeclarativePlaceEditorialModel(this);
262 m_editorialModel->setPlace(this);
263 }
264
265 return m_editorialModel;
266}
267
272{
273 QPlace previous = m_src;
274 m_src = src;
275
276 if (previous.categories() != m_src.categories()) {
277 synchronizeCategories();
279 }
280
281 if (m_location && m_location->parent() == this) {
282 m_location->setLocation(m_src.location());
283 } else if (!m_location || m_location->parent() != this) {
284 m_location = new QDeclarativeGeoLocation(m_src.location(), this);
286 }
287
288 if (previous.ratings() != m_src.ratings())
290 if (previous.supplier() != m_src.supplier())
292 if (previous.icon() != m_src.icon())
294 if (previous.name() != m_src.name())
296 if (previous.placeId() != m_src.placeId())
298 if (previous.attribution() != m_src.attribution())
300 if (previous.detailsFetched() != m_src.detailsFetched())
302 if (previous.primaryPhone() != m_src.primaryPhone())
304 if (previous.primaryFax() != m_src.primaryFax())
306 if (previous.primaryEmail() != m_src.primaryEmail())
308 if (previous.primaryWebsite() != m_src.primaryWebsite())
310
311 if (m_reviewModel && m_src.totalContentCount(QPlaceContent::ReviewType) >= 0) {
314 }
315 if (m_imageModel && m_src.totalContentCount(QPlaceContent::ImageType) >= 0) {
318 }
319 if (m_editorialModel && m_src.totalContentCount(QPlaceContent::EditorialType) >= 0) {
322 }
323
324 pullExtendedAttributes();
325 synchronizeContacts();
326}
327
329{
330 // The properties handled explicirly here are not stored in m_src, but
331 // but are instead stored in QDeclarative* objects which we need to update
332 // explicitly.
333
334 QPlace result = m_src;
335
336 // Categories
337 QList<QPlaceCategory> categories;
338 for (QDeclarativeCategory *value : std::as_const(m_categories))
339 categories.append(value->category());
340
341 result.setCategories(categories);
342
343 // Location
344 result.setLocation(m_location ? m_location->location() : QGeoLocation());
345
346 //contact details
347 QList<QPlaceContactDetail> cppDetails;
348 for (const QString &key : m_contactDetails->keys()) {
349 cppDetails.clear();
350 if (m_contactDetails->value(key).typeId() == QMetaType::QVariantList) {
351 const QVariantList detailsVarList = m_contactDetails->value(key).toList();
352 for (const QVariant &detailVar : detailsVarList)
353 cppDetails.append(detailVar.value<QPlaceContactDetail>());
354 } else {
355 cppDetails.append(m_contactDetails->value(key).value<QPlaceContactDetail>());
356 }
357 result.setContactDetails(key, cppDetails);
358 }
359
360 return result;
361}
362
370{
371 if (m_location == location)
372 return;
373
374 if (m_location && m_location->parent() == this)
375 delete m_location;
376
377 m_location = location;
379}
380
382{
383 return m_location;
384}
385
393{
394 if (m_src.ratings() != rating) {
395 m_src.setRatings(rating);
397 }
398}
399
401{
402 return m_src.ratings();
403}
404
412{
413 if (m_src.supplier() != supplier) {
414 m_src.setSupplier(supplier);
416 }
417}
418
420{
421 return m_src.supplier();
422}
423
430{
431 return m_src.icon();
432}
433
435{
436 if (m_src.icon() != icon) {
437 m_src.setIcon(icon);
439 }
440}
441
448{
449 if (m_src.name() != name) {
450 m_src.setName(name);
452 }
453}
454
456{
457 return m_src.name();
458}
459
472{
473 if (m_src.placeId() != placeId) {
474 m_src.setPlaceId(placeId);
476 }
477}
478
480{
481 return m_src.placeId();
482}
483
493{
494 if (m_src.attribution() != attribution) {
497 }
498}
499
501{
502 return m_src.attribution();
503}
504
515{
516 return m_src.detailsFetched();
517}
518
556void QDeclarativePlace::setStatus(Status status, const QString &errorString)
557{
558 Status originalStatus = m_status;
559 m_status = status;
560 m_errorString = errorString;
561
562 if (originalStatus != m_status)
564}
565
567{
568 return m_status;
569}
570
574void QDeclarativePlace::finished()
575{
576 if (!m_reply)
577 return;
578
579 if (m_reply->error() == QPlaceReply::NoError) {
580 switch (m_reply->type()) {
581 case (QPlaceReply::IdReply) : {
582 QPlaceIdReply *idReply = qobject_cast<QPlaceIdReply *>(m_reply);
583
584 switch (idReply->operationType()) {
586 setPlaceId(idReply->id());
587 break;
589 break;
590 default:
591 //Other operation types shouldn't ever be received.
592 break;
593 }
594 break;
595 }
597 QPlaceDetailsReply *detailsReply = qobject_cast<QPlaceDetailsReply *>(m_reply);
598 setPlace(detailsReply->place());
599 break;
600 }
601 default:
602 //other types of replies shouldn't ever be received.
603 break;
604 }
605
606 m_errorString.clear();
607
608 m_reply->deleteLater();
609 m_reply = nullptr;
610
612 } else {
613 QString errorString = m_reply->errorString();
614
615 m_reply->deleteLater();
616 m_reply = nullptr;
617
619 }
620}
621
625void QDeclarativePlace::contactsModified(const QString &key, const QVariant &)
626{
627 primarySignalsEmission(key);
628}
629
633void QDeclarativePlace::cleanupDeletedCategories()
634{
635 for (QDeclarativeCategory * category : m_categoriesToBeDeleted) {
636 if (category->parent() == this)
637 delete category;
638 }
639 m_categoriesToBeDeleted.clear();
640}
641
653{
654 QPlaceManager *placeManager = manager();
655 if (!placeManager)
656 return;
657
658 m_reply = placeManager->getPlaceDetails(placeId());
659 connect(m_reply, &QPlaceReply::finished, this, &QDeclarativePlace::finished);
661}
662
682{
683 QPlaceManager *placeManager = manager();
684 if (!placeManager)
685 return;
686
687 m_reply = placeManager->savePlace(place());
688 connect(m_reply, &QPlaceReply::finished, this, &QDeclarativePlace::finished);
690}
691
702{
703 QPlaceManager *placeManager = manager();
704 if (!placeManager)
705 return;
706
707 m_reply = placeManager->removePlace(place().placeId());
708 connect(m_reply, &QPlaceReply::finished, this, &QDeclarativePlace::finished);
710}
711
719{
720 return m_errorString;
721}
722
733{
734 return primaryValue(QPlaceContactDetail::Phone);
735}
736
746{
747 return primaryValue(QPlaceContactDetail::Fax);
748}
749
759{
760 return primaryValue(QPlaceContactDetail::Email);
761}
762
773{
774 return QUrl(primaryValue(QPlaceContactDetail::Website));
775}
776
784{
785 return m_extendedAttributes;
786}
787
795{
796 return m_contactDetails;
797}
798
805QQmlListProperty<QDeclarativeCategory> QDeclarativePlace::categories()
806{
807 return QQmlListProperty<QDeclarativeCategory>(this,
808 0, // opaque data parameter
813}
814
818void QDeclarativePlace::category_append(QQmlListProperty<QDeclarativeCategory> *prop,
820{
821 QDeclarativePlace *object = static_cast<QDeclarativePlace *>(prop->object);
822
823 if (object->m_categoriesToBeDeleted.contains(value))
824 object->m_categoriesToBeDeleted.removeAll(value);
825
826 if (!object->m_categories.contains(value)) {
827 object->m_categories.append(value);
828 QList<QPlaceCategory> list = object->m_src.categories();
829 list.append(value->category());
830 object->m_src.setCategories(list);
831
832 emit object->categoriesChanged();
833 }
834}
835
839qsizetype QDeclarativePlace::category_count(QQmlListProperty<QDeclarativeCategory> *prop)
840{
841 return static_cast<QDeclarativePlace *>(prop->object)->m_categories.count();
842}
843
847QDeclarativeCategory *QDeclarativePlace::category_at(QQmlListProperty<QDeclarativeCategory> *prop,
849{
850 QDeclarativePlace *object = static_cast<QDeclarativePlace *>(prop->object);
852 if (object->m_categories.count() > index && index > -1) {
853 res = object->m_categories[index];
854 }
855 return res;
856}
857
861void QDeclarativePlace::category_clear(QQmlListProperty<QDeclarativeCategory> *prop)
862{
863 QDeclarativePlace *object = static_cast<QDeclarativePlace *>(prop->object);
864 if (object->m_categories.isEmpty())
865 return;
866
867 for (auto *category : std::as_const(object->m_categories)) {
868 if (category->parent() == object)
869 object->m_categoriesToBeDeleted.append(category);
870 }
871
872 object->m_categories.clear();
873 object->m_src.setCategories(QList<QPlaceCategory>());
874 emit object->categoriesChanged();
875 QMetaObject::invokeMethod(object, "cleanupDeletedCategories", Qt::QueuedConnection);
876}
877
881void QDeclarativePlace::synchronizeCategories()
882{
883 qDeleteAll(m_categories);
884 m_categories.clear();
885 for (const QPlaceCategory &value : m_src.categories()) {
886 QDeclarativeCategory *declarativeValue = new QDeclarativeCategory(value, m_plugin, this);
887 m_categories.append(declarativeValue);
888 }
889}
890
922
924{
925 if (static_cast<QDeclarativePlace::Visibility>(m_src.visibility()) == visibility)
926 return;
927
930}
931
938{
939 return m_favorite;
940}
941
943{
944
945 if (m_favorite == favorite)
946 return;
947
948 if (m_favorite && m_favorite->parent() == this)
949 delete m_favorite;
950
951 m_favorite = favorite;
953}
954
962{
963 QPlaceManager *placeManager = manager();
964 if (!placeManager)
965 return;
966
967 setPlace(placeManager->compatiblePlace(original->place()));
968}
969
978{
979 if (m_favorite == 0) {
981 place->setPlugin(plugin);
982 place->copyFrom(this);
984 }
985}
986
990void QDeclarativePlace::pullExtendedAttributes()
991{
992 const QStringList keys = m_extendedAttributes->keys();
993 for (const QString &key : keys)
994 m_extendedAttributes->clear(key);
995
996 const QStringList attributeTypes = m_src.extendedAttributeTypes();
997 for (const QString &attributeType : attributeTypes) {
998 m_extendedAttributes->insert(attributeType,
999 QVariant::fromValue(m_src.extendedAttribute(attributeType)));
1000 }
1001
1003}
1004
1008void QDeclarativePlace::synchronizeContacts()
1009{
1010 //clear out contact data
1011 for (const QString &contactType : m_contactDetails->keys()) {
1012 const QList<QVariant> contacts = m_contactDetails->value(contactType).toList();
1013 for (const QVariant &var : contacts) {
1014 QObject *obj = var.value<QObject *>();
1015 if (obj->parent() == this)
1016 delete obj;
1017 }
1018 m_contactDetails->insert(contactType, QVariantList());
1019 }
1020
1021 //insert new contact data from source place
1022 for (const QString &contactType : m_src.contactTypes()) {
1023 const QList<QPlaceContactDetail> sourceContacts = m_src.contactDetails(contactType);
1024 QVariantList declContacts;
1025 for (const QPlaceContactDetail &sourceContact : sourceContacts)
1026 declContacts.append(QVariant::fromValue(sourceContact));
1027 m_contactDetails->insert(contactType, declContacts);
1028 }
1029 primarySignalsEmission();
1030}
1031
1038void QDeclarativePlace::primarySignalsEmission(const QString &type)
1039{
1040 if (type.isEmpty() || type == QPlaceContactDetail::Phone) {
1041 if (m_prevPrimaryPhone != primaryPhone()) {
1042 m_prevPrimaryPhone = primaryPhone();
1044 }
1045 if (!type.isEmpty())
1046 return;
1047 }
1048
1049 if (type.isEmpty() || type == QPlaceContactDetail::Email) {
1050 if (m_prevPrimaryEmail != primaryEmail()) {
1051 m_prevPrimaryEmail = primaryEmail();
1053 }
1054 if (!type.isEmpty())
1055 return;
1056 }
1057
1058 if (type.isEmpty() || type == QPlaceContactDetail::Website) {
1059 if (m_prevPrimaryWebsite != primaryWebsite()) {
1060 m_prevPrimaryWebsite = primaryWebsite();
1062 }
1063 if (!type.isEmpty())
1064 return;
1065 }
1066
1067 if (type.isEmpty() || type == QPlaceContactDetail::Fax) {
1068 if (m_prevPrimaryFax != primaryFax()) {
1069 m_prevPrimaryFax = primaryFax();
1071 }
1072 }
1073}
1074
1081QPlaceManager *QDeclarativePlace::manager()
1082{
1083 if (m_status != QDeclarativePlace::Ready && m_status != QDeclarativePlace::Error)
1084 return nullptr;
1085
1086 if (m_reply) {
1087 m_reply->abort();
1088 m_reply->deleteLater();
1089 m_reply = nullptr;
1090 }
1091
1092 if (!m_plugin) {
1093 qmlWarning(this) << QStringLiteral("Plugin is not assigned to place.");
1094 return nullptr;
1095 }
1096
1097 QGeoServiceProvider *serviceProvider = m_plugin->sharedGeoServiceProvider();
1098 if (!serviceProvider)
1099 return nullptr;
1100
1101 QPlaceManager *placeManager = serviceProvider->placeManager();
1102
1103 if (!placeManager) {
1105 .arg(m_plugin->name()).arg(serviceProvider->errorString()));
1106 return nullptr;
1107 }
1108
1109 return placeManager;
1110}
1111
1115QString QDeclarativePlace::primaryValue(const QString &contactType) const
1116{
1117 QVariant value = m_contactDetails->value(contactType);
1118 if (value.userType() == qMetaTypeId<QJSValue>())
1120
1121 if (value.userType() == QMetaType::QVariantList) {
1122 QVariantList detailList = m_contactDetails->value(contactType).toList();
1123 if (!detailList.isEmpty())
1124 return detailList.at(0).value<QPlaceContactDetail>().value();
1125 } else if (value.metaType() == QMetaType::fromType<QPlaceContactDetail>()) {
1126 return value.value<QPlaceContactDetail>().value();
1127 }
1128
1129 return QString();
1130}
1131
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
void setLocation(const QGeoLocation &src)
\qmlproperty QGeoLocation QtPositioning::Location::location
QGeoServiceProvider * sharedGeoServiceProvider() const
void initializeCollection(int totalCount, const QPlaceContent::Collection &collection)
void primaryWebsiteChanged()
QDeclarativePlaceReviewModel * reviewModel
\qmlproperty ReviewModel Place::reviewModel
void setStatus(Status status, const QString &errorString=QString())
\qmlproperty enumeration Place::status
void primaryPhoneChanged()
void setLocation(QDeclarativeGeoLocation *location)
\qmlproperty QtPositioning::Location Place::location
Q_INVOKABLE QString errorString() const
\qmlmethod string Place::errorString()
QDeclarativePlaceImageModel * imageModel
\qmlproperty ImageModel Place::imageModel
static qsizetype category_count(QQmlListProperty< QDeclarativeCategory > *prop)
QDeclarativePlace * favorite
static QDeclarativeCategory * category_at(QQmlListProperty< QDeclarativeCategory > *prop, qsizetype index)
void setPlaceId(const QString &placeId)
\qmlproperty string Place::placeId
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setFavorite(QDeclarativePlace *favorite)
void setPlace(const QPlace &src)
void setSupplier(const QPlaceSupplier &supplier)
\qmlproperty Supplier Place::supplier
void extendedAttributesChanged()
QDeclarativePlace(QObject *parent=nullptr)
\qmltype Place \instantiates QDeclarativePlace \inqmlmodule QtLocation
Q_INVOKABLE void remove()
\qmlmethod void Place::remove()
QDeclarativeGeoServiceProvider * plugin
static void category_clear(QQmlListProperty< QDeclarativeCategory > *prop)
QDeclarativeContactDetails * contactDetails
void detailsFetchedChanged()
Q_INVOKABLE void getDetails()
\qmlmethod void Place::getDetails()
void setPlugin(QDeclarativeGeoServiceProvider *plugin)
\qmlproperty Plugin Place::plugin
void setVisibility(Visibility visibility)
void attributionChanged()
QDeclarativePlaceEditorialModel * editorialModel
\qmlproperty EditorialModel Place::editorialModel
static void category_append(QQmlListProperty< QDeclarativeCategory > *prop, QDeclarativeCategory *value)
void setIcon(const QPlaceIcon &icon)
void setAttribution(const QString &attribution)
\qmlproperty string Place::attribution
void primaryFaxChanged()
void visibilityChanged()
Q_INVOKABLE void initializeFavorite(QDeclarativeGeoServiceProvider *plugin)
\qmlmethod void Place::initializeFavorite(Plugin destinationPlugin)
Q_INVOKABLE void save()
\qmlmethod void Place::save()
void setRatings(const QPlaceRatings &ratings)
\qmlproperty Ratings Place::ratings
QQmlListProperty< QDeclarativeCategory > categories
\qmlproperty list<Category> Place::categories
void primaryEmailChanged()
QPlaceSupplier supplier
Q_INVOKABLE void copyFrom(QDeclarativePlace *original)
\qmlmethod void Place::copyFrom(Place original)
void categoriesChanged()
QDeclarativeGeoLocation * location
void setName(const QString &name)
\qmlproperty string Place::name
\inmodule QtPositioning
\inmodule QtLocation
Error error() const
Returns an error code describing the error which occurred during the last operation that was performe...
QPlaceManager * placeManager() const
Returns the QPlaceManager made available by the service provider.
QString errorString() const
Returns a string describing the error which occurred during the last operation that was performed by ...
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
qsizetype removeAll(const AT &t)
Definition qlist.h:592
qsizetype count() const noexcept
Definition qlist.h:398
void append(parameter_type t)
Definition qlist.h:458
void clear()
Definition qlist.h:434
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
void deleteLater()
\threadsafe
Definition qobject.cpp:2435
\inmodule QtLocation
The QPlaceContactDetail class represents a contact detail such as a phone number or website url.
static const QString Fax
\variable QPlaceContactDetail::Fax The constant used to specify fax contact details.
static const QString Website
\variable QPlaceContactDetail::Website The constant used to specify website contact details.
static const QString Phone
\qmlvaluetype contactDetail \inqmlmodule QtLocation
static const QString Email
\variable QPlaceContactDetail::Email The constant to specify email contact details.
\inmodule QtLocation
QPlace place() const
Returns the place that was fetched.
\inmodule QtLocation
Definition qplaceicon.h:23
\inmodule QtLocation
\inmodule QtLocation
QPlaceIdReply * savePlace(const QPlace &place)
Saves a specified place.
QPlaceDetailsReply * getPlaceDetails(const QString &placeId) const
Retrieves a details of place corresponding to the given placeId.
QPlace compatiblePlace(const QPlace &place) const
Returns a pruned or modified version of the original place which is suitable to be saved into this ma...
QPlaceIdReply * removePlace(const QString &placeId)
Removes the place corresponding to placeId from the manager.
\inmodule QtLocation
QPlaceReply::Error error() const
Returns the error code.
void finished()
This signal is emitted when this reply has finished processing.
virtual void abort()
Cancels the operation immediately.
QString errorString() const
Returns the error string of the reply.
virtual Type type() const
Returns the type of the reply.
\inmodule QtLocation
\inmodule QtLocation
Definition qplace.h:25
void setVisibility(QLocation::Visibility visibility)
Sets the visibility of the place to visibility.
Definition qplace.cpp:528
QString primaryPhone() const
Returns the primary phone number for this place.
Definition qplace.cpp:356
void setIcon(const QPlaceIcon &icon)
Sets the icon of the place.
Definition qplace.cpp:347
QList< QPlaceContactDetail > contactDetails(const QString &contactType) const
Returns a list of contact details of the specified contactType.
Definition qplace.cpp:482
QLocation::Visibility visibility() const
Returns the visibility of the place.
Definition qplace.cpp:540
void setPlaceId(const QString &identifier)
Sets the identifier of the place.
Definition qplace.cpp:314
void setAttribution(const QString &attribution)
Sets the attribution string of the place.
Definition qplace.cpp:331
void setRatings(const QPlaceRatings &ratings)
Sets the aggregated rating of the place.
Definition qplace.cpp:213
QStringList extendedAttributeTypes() const
Returns the types of extended attributes that this place has.
Definition qplace.cpp:426
QPlaceIcon icon() const
Returns the icon of the place.
Definition qplace.cpp:339
QUrl primaryWebsite() const
Returns the primary website of the place.
Definition qplace.cpp:397
QString primaryEmail() const
Returns the primary email address for this place.
Definition qplace.cpp:383
QList< QPlaceCategory > categories() const
Returns categories that this place belongs to.
Definition qplace.cpp:164
int totalContentCount(QPlaceContent::Type type) const
Returns the total count of content objects of the given type.
Definition qplace.cpp:272
QString attribution() const
Returns a rich text attribution string of the place.
Definition qplace.cpp:323
QGeoLocation location() const
Returns the location of the place.
Definition qplace.cpp:189
QPlaceAttribute extendedAttribute(const QString &attributeType) const
Returns the exteded attribute corresponding to the specified attributeType.
Definition qplace.cpp:436
QPlaceSupplier supplier() const
Returns the supplier of this place.
Definition qplace.cpp:221
void setSupplier(const QPlaceSupplier &supplier)
Sets the supplier of this place to supplier.
Definition qplace.cpp:229
QString primaryFax() const
Returns the primary fax number for this place.
Definition qplace.cpp:369
void setName(const QString &name)
Sets the name of the place.
Definition qplace.cpp:296
QPlaceRatings ratings() const
Returns an aggregated rating of the place.
Definition qplace.cpp:205
QString placeId() const
Returns the identifier of the place.
Definition qplace.cpp:306
QPlaceContent::Collection content(QPlaceContent::Type type) const
Returns a collection of content associated with a place.
Definition qplace.cpp:241
bool detailsFetched() const
Returns true if the details of this place have been fetched, otherwise returns false.
Definition qplace.cpp:410
QString name() const
Returns the name of the place.
Definition qplace.cpp:288
The QQmlPropertyMap class allows you to set key-value pairs that can be used in QML bindings.
Q_INVOKABLE QStringList keys() const
Returns the list of keys.
void valueChanged(const QString &key, const QVariant &value)
This signal is emitted whenever one of the values in the map is changed.
void insert(const QString &key, const QVariant &value)
Sets the value associated with key to value.
QVariant value(const QString &key) const
Returns the value associated with key.
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void clear()
Clears the contents of the string and makes it null.
Definition qstring.h:1252
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:65
T value() const &
Definition qvariant.h:516
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has userType() \l QMetaType::QVariantList.
int typeId() const
Returns the storage type of the value stored in the variant.
Definition qvariant.h:340
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Definition qvariant.h:536
#define this
Definition dialogs.cpp:9
const QLoggingCategory & category()
[1]
b clear()
list append(new Employee("Blackpool", "Stephen"))
qDeleteAll(list.begin(), list.end())
QT_BEGIN_NAMESPACE const char CONTEXT_NAME[]
const char PLUGIN_ERROR[]
Combined button and popup list for selecting options.
@ QueuedConnection
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
QList< QVariant > QVariantList
Definition qjsonarray.h:15
GLint location
GLuint64 key
GLuint index
[2]
GLuint object
[3]
GLenum src
GLenum type
GLuint name
GLhandleARB obj
[2]
GLsizei GLenum * categories
GLuint res
GLuint64EXT * result
[6]
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int void * arg
#define QStringLiteral(str)
#define emit
ptrdiff_t qsizetype
Definition qtypes.h:165
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, JSToQVariantConversionBehavior conversionBehavior, V4ObjectSet *visitedObjects)
QList< int > list
[14]
QStringList keys
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
\threadsafe This is an overloaded member function, provided for convenience. It differs from the abov...