Interfaces between C++ and QML Code in Qt Location¶
Some of the location QML types providing interfaces to access and modify properties in C++.
Category - QPlaceCategory¶
The Category.category property is used to provide an interface between C++ and QML code. First a pointer to a Category object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set thecategory
property. The following gets theQPlaceCategory
representing this object from C++:QPlaceCategory category = qmlObject->property("category").value<QPlaceCategory>();The following sets the properties of this object based on a
QPlaceCategory
object from C++:qmlObject->setProperty("category", QVariant::fromValue(category));
ContactDetail - QDeclarativeContactDetail¶
The ContactDetail.contactDetail property is used to provide an interface between C++ and QML code. First a pointer to a ContactDetail object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set thecontactDetail
property. The following gets theQPlaceContactDetail
representing this object from C++:QPlaceContactDetail contactDetail = qmlObject->property("contactDetail").value<QPlaceContactDetail>();The following sets the properties of this object based on a
QPlaceContactDetail
object from C++:qmlObject->setProperty("contactDetail", QVariant::fromValue(contactDetail));
Place - QPlace¶
The Place.place property is used to provide an interface between C++ and QML code. First a pointer to a Place object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set theplace
property. The following gets theQPlace
representing this object from C++:QPlace place = qmlObject->property("place").value<QPlace>();The following sets the properties of this object based on a
QPlace
object from C++:qmlObject->setProperty("place", QVariant::fromValue(place));
PlaceAttribute - QPlaceAttribute¶
The PlaceAttribute.attribute property is used to provide an interface between C++ and QML code. First a pointer to a PlaceAttribute object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set theattribute
property. The following gets theQPlaceAttribute
representing this object from C++:QPlaceAttribute placeAttribute = qmlObject->property("attribute").value<QPlaceAttribute>();The following sets the properties of this object based on a
QPlaceAttribute
object from C++:qmlObject->setProperty("attribute", QVariant::fromValue(placeAttribute));
Icon - QPlaceIcon¶
The Icon.icon property is used to provide an interface between C++ and QML code. First a pointer to a Icon object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set theicon
property. The following gets theQPlaceIcon
representing this object from C++:QPlaceIcon placeIcon = qmlObject->property("icon").value<QPlaceIcon>();The following sets the properties of this object based on a
QPlaceIcon
object from C++:qmlObject->setProperty("icon", QVariant::fromValue(placeIcon));
User - QPlaceUser¶
The User.user property is used to provide an interface between C++ and QML code. First a pointer to a User object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set theuser
property. The following gets theQPlaceUser
representing this object from C++:QPlaceUser placeUser = qmlObject->property("user").value<QPlaceUser>();The following sets the properties of this object based on a
QPlaceUser
object from C++:qmlObject->setProperty("user", QVariant::fromValue(placeUser));
Ratings - QPlaceRatings¶
The Ratings.ratings property is used to provide an interface between C++ and QML code. First a pointer to a Ratings object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set theratings
property. The following gets the QPlaceRating representing this object from C++:QPlaceRatings placeRatings = qmlObject->property("ratings").value<QPlaceRatings>();The following sets the properties of this object based on a
QPlaceRatings
object from C++:qmlObject->setProperty("ratings", QVariant::fromValue(placeRatings));
Supplier - QPlaceSupplier¶
The Supplier.supplier property is used to provide an interface between C++ and QML code. First a pointer to a Supplier object must be obtained from C++, then use the
property()
andsetProperty()
functions to get and set thesupplier
property. The following gets theQPlaceSupplier
representing this object from C++:QPlaceSupplier placeSupplier = qmlObject->property("supplier").value<QPlaceSupplier>();The following sets the properties of this object based on a
QPlaceSupplier
object from C++:qmlObject->setProperty("supplier", QVariant::fromValue(placeSupplier));
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.