diff options
Diffstat (limited to 'src/location')
38 files changed, 317 insertions, 56 deletions
diff --git a/src/location/CMakeLists.txt b/src/location/CMakeLists.txt index bf921f79..38f46485 100644 --- a/src/location/CMakeLists.txt +++ b/src/location/CMakeLists.txt @@ -69,6 +69,56 @@ qt_internal_add_module(Location places/qplaceratings.h places/qplaceratings_p.h places/qplaceratings.cpp places/qplacecontactdetail.h places/qplacecontactdetail_p.h places/qplacecontactdetail.cpp places/qplacecontent.h places/qplacecontent_p.h places/qplacecontent.cpp + INCLUDE_DIRECTORIES + maps + places + declarativemaps + declarativeplaces + quickmapitems + ../3rdparty/earcut + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::QuickPrivate + Qt::PositioningPrivate + Qt::PositioningQuickPrivate + Qt::Qml + Qt::Quick + PUBLIC_LIBRARIES + Qt::Core + Qt::Positioning + Qt::PositioningQuick + PRIVATE_MODULE_INTERFACE + Qt::CorePrivate + Qt::QuickPrivate + Qt::PositioningPrivate + Qt::PositioningQuickPrivate + DEFINES + QT_NO_FOREACH + GENERATE_CPP_EXPORTS + GENERATE_PRIVATE_CPP_EXPORTS +) + +qt_internal_add_qml_module(Location + URI QtLocation + VERSION ${PROJECT_VERSION} + PLUGIN_TARGET declarative_location + NO_PLUGIN_OPTIONAL + CLASS_NAME QtLocationDeclarativeModule + SOURCES + qlocation_quick.cpp + # value types + maps/qgeomaptype_p.h + maps/qgeomaneuver.h + maps/qgeoroute.h + maps/qgeoroutesegment.h + places/qplaceattribute.h + places/qplacecontactdetail.h + places/qplaceicon.h + places/qplaceratings.h + places/qplacesupplier.h + places/qplaceuser.h + # Element types declarativemaps/qdeclarativegeoserviceprovider_p.h declarativemaps/qdeclarativegeoserviceprovider.cpp declarativemaps/qdeclarativegeomapparameter_p.h @@ -122,34 +172,8 @@ qt_internal_add_module(Location declarativeplaces/qdeclarativesearchsuggestionmodel_p.h declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h - INCLUDE_DIRECTORIES - maps - places - declarativemaps - declarativeplaces - quickmapitems - ../3rdparty/earcut - LIBRARIES - Qt::CorePrivate - Qt::Gui - Qt::QuickPrivate - Qt::PositioningPrivate - Qt::PositioningQuickPrivate - Qt::Qml - PUBLIC_LIBRARIES - Qt::Core - Qt::Positioning - Qt::Network - Qt::PositioningQuick - PRIVATE_MODULE_INTERFACE - Qt::CorePrivate - Qt::QuickPrivate - Qt::PositioningPrivate - Qt::PositioningQuickPrivate DEFINES QT_NO_FOREACH - GENERATE_CPP_EXPORTS - GENERATE_PRIVATE_CPP_EXPORTS ) qt_internal_add_shaders(Location "declarative_location_shaders" diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel_p.h b/src/location/declarativemaps/qdeclarativegeocodemodel_p.h index 95385fb1..77eb6932 100644 --- a/src/location/declarativemaps/qdeclarativegeocodemodel_p.h +++ b/src/location/declarativemaps/qdeclarativegeocodemodel_p.h @@ -73,6 +73,7 @@ class QDeclarativeGeoLocation; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeocodeModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(GeocodeModel) Q_ENUMS(Status) Q_ENUMS(GeocodeError) diff --git a/src/location/declarativemaps/qdeclarativegeomapparameter_p.h b/src/location/declarativemaps/qdeclarativegeomapparameter_p.h index 8fa5bfd1..23d028cd 100644 --- a/src/location/declarativemaps/qdeclarativegeomapparameter_p.h +++ b/src/location/declarativemaps/qdeclarativegeomapparameter_p.h @@ -61,6 +61,8 @@ QT_BEGIN_NAMESPACE class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapParameter : public QGeoMapParameter, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(DynamicMapParameter) + QML_ADDED_IN_VERSION(5, 0) Q_INTERFACES(QQmlParserStatus) // this type must not declare any additional properties diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h index 648883f3..414d8a03 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h @@ -67,15 +67,15 @@ class QDeclarativeGeoRouteQuery; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRoute : public QObject { Q_OBJECT - + QML_NAMED_ELEMENT(Route) Q_PROPERTY(QGeoRectangle bounds READ bounds CONSTANT) Q_PROPERTY(int travelTime READ travelTime CONSTANT) Q_PROPERTY(qreal distance READ distance CONSTANT) Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(QList<QGeoRouteSegment> segments READ segments CONSTANT) - Q_PROPERTY(QDeclarativeGeoRouteQuery *routeQuery READ routeQuery REVISION 11) - Q_PROPERTY(QList<QDeclarativeGeoRoute *> legs READ legs CONSTANT REVISION 12) - Q_PROPERTY(QVariantMap extendedAttributes READ extendedAttributes CONSTANT REVISION 13) + Q_PROPERTY(QDeclarativeGeoRouteQuery *routeQuery READ routeQuery REVISION(5, 11)) + Q_PROPERTY(QList<QDeclarativeGeoRoute *> legs READ legs CONSTANT REVISION(5, 12)) + Q_PROPERTY(QVariantMap extendedAttributes READ extendedAttributes CONSTANT REVISION(5, 13)) Q_PROPERTY(int legIndex READ legIndex CONSTANT) Q_PROPERTY(QDeclarativeGeoRoute *overallRoute READ overallRoute CONSTANT) diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h index 628a1e05..9276ef2a 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h @@ -75,6 +75,8 @@ class QDeclarativeGeoRouteQuery; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRouteModel : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(RouteModel) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Status) Q_ENUMS(RouteError) @@ -193,6 +195,8 @@ private: class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoWaypoint : public QGeoCoordinateObject, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(Waypoint) + QML_ADDED_IN_VERSION(5, 11) Q_PROPERTY(double latitude READ latitude WRITE setLatitude STORED false) Q_PROPERTY(double longitude READ longitude WRITE setLongitude STORED false) @@ -276,6 +280,8 @@ protected: class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRouteQuery : public QObject, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(RouteQuery) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(TravelMode) Q_ENUMS(FeatureType) Q_ENUMS(FeatureWeight) @@ -295,8 +301,8 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRouteQuery : public QObject, publ Q_PROPERTY(QVariantList waypoints READ waypoints WRITE setWaypoints NOTIFY waypointsChanged) Q_PROPERTY(QList<QGeoRectangle> excludedAreas READ excludedAreas WRITE setExcludedAreas NOTIFY excludedAreasChanged) Q_PROPERTY(QList<int> featureTypes READ featureTypes NOTIFY featureTypesChanged) - Q_PROPERTY(QVariantMap extraParameters READ extraParameters REVISION 11) - Q_PROPERTY(QDateTime departureTime READ departureTime WRITE setDepartureTime NOTIFY departureTimeChanged REVISION 13) + Q_PROPERTY(QVariantMap extraParameters READ extraParameters REVISION(5, 11)) + Q_PROPERTY(QDateTime departureTime READ departureTime WRITE setDepartureTime NOTIFY departureTimeChanged REVISION(5, 13)) Q_PROPERTY(QQmlListProperty<QObject> quickChildren READ declarativeChildren DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "quickChildren") Q_INTERFACES(QQmlParserStatus) diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h index 28df81da..02aa56a7 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h @@ -67,9 +67,20 @@ QT_BEGIN_NAMESPACE class QDeclarativeGeoServiceProviderRequirements; +// From QtPositioning, needs to be registered in the Location module as well. +// Can probably just be a QVariantMap? +class QDeclarativePluginParameterForeign +{ + Q_GADGET + QML_FOREIGN(QDeclarativePluginParameter) + QML_NAMED_ELEMENT(PluginParameter) +}; + class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoServiceProvider : public QObject, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(Plugin) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(RoutingFeature) Q_ENUMS(GeocodingFeature) Q_ENUMS(MappingFeature) @@ -220,6 +231,9 @@ private: class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoServiceProviderRequirements : public QObject { Q_OBJECT + QML_NAMED_ELEMENT(PluginRequirements) + QML_UNCREATABLE("PluginRequirements is not intended instantiable by developer.") + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QDeclarativeGeoServiceProvider::MappingFeatures mapping READ mappingRequirements WRITE setMappingRequirements NOTIFY mappingRequirementsChanged) diff --git a/src/location/declarativeplaces/qdeclarativecategory_p.h b/src/location/declarativeplaces/qdeclarativecategory_p.h index c4a0b4f3..01304b0c 100644 --- a/src/location/declarativeplaces/qdeclarativecategory_p.h +++ b/src/location/declarativeplaces/qdeclarativecategory_p.h @@ -69,6 +69,8 @@ class QPlaceManager; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeCategory : public QObject, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(Category) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Status Visibility) diff --git a/src/location/declarativeplaces/qdeclarativecontactdetails_p.h b/src/location/declarativeplaces/qdeclarativecontactdetails_p.h index 32c0fe43..a8fc5c97 100644 --- a/src/location/declarativeplaces/qdeclarativecontactdetails_p.h +++ b/src/location/declarativeplaces/qdeclarativecontactdetails_p.h @@ -60,6 +60,11 @@ QT_BEGIN_NAMESPACE class Q_LOCATION_PRIVATE_EXPORT QDeclarativeContactDetails : public QQmlPropertyMap { Q_OBJECT + QML_NAMED_ELEMENT(ContactDetails) + QML_ADDED_IN_VERSION(5, 0) + QML_UNCREATABLE("ContactDetails instances cannot be instantiated. " + "Only Place types have ContactDetails and they cannot " + "be re-assigned (but can be modified).") public: explicit QDeclarativeContactDetails(QObject *parent = nullptr); diff --git a/src/location/declarativeplaces/qdeclarativeplace_p.h b/src/location/declarativeplaces/qdeclarativeplace_p.h index e4d94017..5b1f8274 100644 --- a/src/location/declarativeplaces/qdeclarativeplace_p.h +++ b/src/location/declarativeplaces/qdeclarativeplace_p.h @@ -74,7 +74,8 @@ class QDeclarativeContactDetails; class Q_LOCATION_PRIVATE_EXPORT QDeclarativePlace : public QObject, public QQmlParserStatus { Q_OBJECT - + QML_NAMED_ELEMENT(Place) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Status Visibility) Q_PROPERTY(QPlace place READ place WRITE setPlace) diff --git a/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h b/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h index c5b09eaa..21cb4c32 100644 --- a/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h +++ b/src/location/declarativeplaces/qdeclarativeplacecontentmodel_p.h @@ -150,6 +150,10 @@ private: class QDeclarativePlaceReviewModel : public QDeclarativePlaceContentModel { + Q_GADGET + QML_NAMED_ELEMENT(ReviewModel) + QML_ADDED_IN_VERSION(5, 0) + public: explicit QDeclarativePlaceReviewModel(QObject *parent = nullptr) : QDeclarativePlaceContentModel(QPlaceContent::ReviewType, parent) @@ -158,6 +162,9 @@ public: class QDeclarativePlaceEditorialModel : public QDeclarativePlaceContentModel { + Q_GADGET + QML_NAMED_ELEMENT(EditorialModel) + QML_ADDED_IN_VERSION(5, 0) public: explicit QDeclarativePlaceEditorialModel(QObject *parent = nullptr) : QDeclarativePlaceContentModel(QPlaceContent::EditorialType, parent) @@ -166,6 +173,9 @@ public: class QDeclarativePlaceImageModel : public QDeclarativePlaceContentModel { + Q_GADGET + QML_NAMED_ELEMENT(ImageModel) + QML_ADDED_IN_VERSION(5, 0) public: explicit QDeclarativePlaceImageModel(QObject *parent = nullptr) : QDeclarativePlaceContentModel(QPlaceContent::ImageType, parent) diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h b/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h index 8d6d2570..46f9531b 100644 --- a/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h +++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel_p.h @@ -64,6 +64,8 @@ class QDeclarativeGeoServiceProvider; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeSearchResultModel : public QDeclarativeSearchModelBase { Q_OBJECT + QML_NAMED_ELEMENT(PlaceSearchModel) + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QString searchTerm READ searchTerm WRITE setSearchTerm NOTIFY searchTermChanged) Q_PROPERTY(QQmlListProperty<QDeclarativeCategory> categories READ categories NOTIFY categoriesChanged) @@ -75,7 +77,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeSearchResultModel : public QDeclarat Q_PROPERTY(QDeclarativeGeoServiceProvider *favoritesPlugin READ favoritesPlugin WRITE setFavoritesPlugin NOTIFY favoritesPluginChanged) Q_PROPERTY(QVariantMap favoritesMatchParameters READ favoritesMatchParameters WRITE setFavoritesMatchParameters NOTIFY favoritesMatchParametersChanged) - Q_PROPERTY(bool incremental MEMBER m_incremental NOTIFY incrementalChanged REVISION 12) + Q_PROPERTY(bool incremental MEMBER m_incremental NOTIFY incrementalChanged REVISION(5, 12)) Q_ENUMS(SearchResultType RelevanceHint) diff --git a/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h b/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h index cb8c1da4..f13da3df 100644 --- a/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h +++ b/src/location/declarativeplaces/qdeclarativesearchsuggestionmodel_p.h @@ -64,6 +64,8 @@ class QGeoServiceProvider; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeSearchSuggestionModel : public QDeclarativeSearchModelBase { Q_OBJECT + QML_NAMED_ELEMENT(PlaceSearchSuggestionModel) + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QString searchTerm READ searchTerm WRITE setSearchTerm NOTIFY searchTermChanged) Q_PROPERTY(QStringList suggestions READ suggestions NOTIFY suggestionsChanged) diff --git a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h index 225f6241..58c6529e 100644 --- a/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h +++ b/src/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h @@ -74,6 +74,8 @@ class QPlaceReply; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeSupportedCategoriesModel : public QAbstractItemModel, public QQmlParserStatus { Q_OBJECT + QML_NAMED_ELEMENT(CategoryModel) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Status) diff --git a/src/location/maps/qgeomaneuver.h b/src/location/maps/qgeomaneuver.h index 1308bade..97d3c86b 100644 --- a/src/location/maps/qgeomaneuver.h +++ b/src/location/maps/qgeomaneuver.h @@ -43,6 +43,7 @@ #include <QtCore/QObject> #include <QtCore/qshareddata.h> #include <QtLocation/qlocationglobal.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -54,6 +55,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoManeuverPrivate, Q_LOCATION_ class Q_LOCATION_EXPORT QGeoManeuver { Q_GADGET + QML_VALUE_TYPE(routeManeuver) Q_ENUMS(InstructionDirection) Q_PROPERTY(bool valid READ isValid CONSTANT) @@ -127,6 +129,13 @@ private: Q_DECLARE_SHARED(QGeoManeuver) +namespace QGeoManeuverForeignNamespace +{ + Q_NAMESPACE + QML_FOREIGN_NAMESPACE(QGeoManeuver) + QML_NAMED_ELEMENT(RouteManeuver) +} + QT_END_NAMESPACE Q_DECLARE_METATYPE(QGeoManeuver) diff --git a/src/location/maps/qgeomaptype_p.h b/src/location/maps/qgeomaptype_p.h index 741e7865..4d1f12db 100644 --- a/src/location/maps/qgeomaptype_p.h +++ b/src/location/maps/qgeomaptype_p.h @@ -54,8 +54,9 @@ #include <QtCore/QObject> #include <QtCore/QString> #include <QtCore/QSharedDataPointer> +#include <QtCore/QVariantMap> #include <QtLocation/private/qlocationglobal_p.h> -#include <QVariantMap> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -66,6 +67,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoMapTypePrivate, Q_LOCATION_P class Q_LOCATION_PRIVATE_EXPORT QGeoMapType { Q_GADGET + QML_VALUE_TYPE(mapType) Q_ENUMS(MapStyle) Q_PROPERTY(MapStyle style READ style CONSTANT) @@ -75,6 +77,8 @@ class Q_LOCATION_PRIVATE_EXPORT QGeoMapType Q_PROPERTY(bool night READ night CONSTANT) Q_PROPERTY(QGeoCameraCapabilities cameraCapabilities READ cameraCapabilities CONSTANT) Q_PROPERTY(QVariantMap metadata READ metadata CONSTANT) + + Q_MOC_INCLUDE(<QtLocation/private/qgeocameracapabilities_p.h>) public: enum MapStyle { // ### Qt6: change this to be a QFlags instead, or remove. NoMap = 0, @@ -126,6 +130,13 @@ private: bool isEqual(const QGeoMapType &other) const noexcept; }; +namespace QGeoMapTypeForeignNamespace +{ + Q_NAMESPACE + QML_FOREIGN_NAMESPACE(QGeoMapType) + QML_NAMED_ELEMENT(MapType) +}; + QT_END_NAMESPACE #endif // QGEOMAPTYPE_H diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h index 99eb699e..3450af25 100644 --- a/src/location/maps/qgeoroute.h +++ b/src/location/maps/qgeoroute.h @@ -46,6 +46,8 @@ #include <QtCore/QExplicitlySharedDataPointer> #include <QtCore/QList> +#include "QtQml/qqml.h" + QT_BEGIN_NAMESPACE class QGeoCoordinate; @@ -57,6 +59,7 @@ QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoRoutePrivate, Q_LOCATION_EX class Q_LOCATION_EXPORT QGeoRoute { Q_GADGET + QML_NAMED_ELEMENT(route) Q_PROPERTY(QGeoRectangle bounds READ bounds CONSTANT) Q_PROPERTY(int travelTime READ travelTime CONSTANT) diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h index da17455a..6b70863a 100644 --- a/src/location/maps/qgeoroute_p.h +++ b/src/location/maps/qgeoroute_p.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE class QGeoCoordinate; -class QGeoRoutePrivate : public QSharedData +class Q_LOCATION_PRIVATE_EXPORT QGeoRoutePrivate : public QSharedData { public: bool operator==(const QGeoRoutePrivate &other) const; diff --git a/src/location/maps/qgeoroutesegment.h b/src/location/maps/qgeoroutesegment.h index c32f8e92..7ab8a771 100644 --- a/src/location/maps/qgeoroutesegment.h +++ b/src/location/maps/qgeoroutesegment.h @@ -44,6 +44,7 @@ #include <QtCore/QExplicitlySharedDataPointer> #include <QtCore/QList> #include <QtLocation/qlocationglobal.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -55,6 +56,7 @@ QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoRouteSegmentPrivate, Q_LOCA class Q_LOCATION_EXPORT QGeoRouteSegment { Q_GADGET + QML_VALUE_TYPE(routeSegment) Q_PROPERTY(int travelTime READ travelTime CONSTANT) Q_PROPERTY(qreal distance READ distance CONSTANT) diff --git a/src/location/places/qplaceattribute.h b/src/location/places/qplaceattribute.h index 9e865817..5e628f26 100644 --- a/src/location/places/qplaceattribute.h +++ b/src/location/places/qplaceattribute.h @@ -45,6 +45,7 @@ #include <QtCore/QSharedDataPointer> #include <QtLocation/qlocationglobal.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -54,6 +55,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceAttributePrivate, Q_LOCATI class Q_LOCATION_EXPORT QPlaceAttribute { Q_GADGET + QML_VALUE_TYPE(placeAttribute) Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(QString text READ text WRITE setText) diff --git a/src/location/places/qplacecontactdetail.h b/src/location/places/qplacecontactdetail.h index 3fed6a1e..5801a1f0 100644 --- a/src/location/places/qplacecontactdetail.h +++ b/src/location/places/qplacecontactdetail.h @@ -45,6 +45,7 @@ #include <QtCore/QSharedDataPointer> #include <QtLocation/qlocationglobal.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -54,6 +55,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceContactDetailPrivate, Q_LO class Q_LOCATION_EXPORT QPlaceContactDetail { Q_GADGET + QML_VALUE_TYPE(contactDetail) Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(QString value READ value WRITE setValue) diff --git a/src/location/places/qplaceicon.h b/src/location/places/qplaceicon.h index 6ae4d636..2360553c 100644 --- a/src/location/places/qplaceicon.h +++ b/src/location/places/qplaceicon.h @@ -45,6 +45,7 @@ #include <QtCore/QMetaType> #include <QtCore/QSize> #include <QtCore/QSharedDataPointer> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -57,6 +58,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceIconPrivate, Q_LOCATION_EX class Q_LOCATION_EXPORT QPlaceIcon { Q_GADGET + QML_VALUE_TYPE(icon) Q_PROPERTY(QVariantMap parameters READ parameters WRITE setParameters) Q_PROPERTY(QPlaceManager *manager READ manager WRITE setManager) diff --git a/src/location/places/qplaceratings.h b/src/location/places/qplaceratings.h index 019c20b1..6a73fb9a 100644 --- a/src/location/places/qplaceratings.h +++ b/src/location/places/qplaceratings.h @@ -43,6 +43,7 @@ #include <QtCore/QMetaType> #include <QtCore/QSharedDataPointer> #include <QtLocation/qlocationglobal.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -52,6 +53,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceRatingsPrivate, Q_LOCATION class Q_LOCATION_EXPORT QPlaceRatings { Q_GADGET + QML_VALUE_TYPE(ratings) Q_PROPERTY(qreal average READ average WRITE setAverage) Q_PROPERTY(qreal maximum READ maximum WRITE setMaximum) Q_PROPERTY(int count READ count WRITE setCount) diff --git a/src/location/places/qplacesupplier.h b/src/location/places/qplacesupplier.h index cf4421b2..81a4aff5 100644 --- a/src/location/places/qplacesupplier.h +++ b/src/location/places/qplacesupplier.h @@ -43,6 +43,7 @@ #include <QtLocation/qlocationglobal.h> #include <QtCore/QMetaType> #include <QtCore/QSharedDataPointer> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -54,6 +55,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceSupplierPrivate, Q_LOCATIO class Q_LOCATION_EXPORT QPlaceSupplier { Q_GADGET + QML_VALUE_TYPE(supplier) Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QString supplierId READ supplierId WRITE setSupplierId) Q_PROPERTY(QUrl url READ url WRITE setUrl) diff --git a/src/location/places/qplaceuser.h b/src/location/places/qplaceuser.h index b4c2f915..6dcca89b 100644 --- a/src/location/places/qplaceuser.h +++ b/src/location/places/qplaceuser.h @@ -43,6 +43,7 @@ #include <QtCore/QMetaType> #include <QtCore/QSharedDataPointer> #include <QtLocation/qlocationglobal.h> +#include <QtQml/qqml.h> QT_BEGIN_NAMESPACE @@ -52,6 +53,7 @@ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceUserPrivate, Q_LOCATION_EX class Q_LOCATION_EXPORT QPlaceUser { Q_GADGET + QML_VALUE_TYPE(user) Q_PROPERTY(QString userId READ userId WRITE setUserId) Q_PROPERTY(QString name READ name WRITE setName) diff --git a/src/location/qlocation_quick.cpp b/src/location/qlocation_quick.cpp new file mode 100644 index 00000000..0ad82693 --- /dev/null +++ b/src/location/qlocation_quick.cpp @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtLocation/qplaceratings.h> +#include <QtLocation/qplaceicon.h> +#include <QtLocation/qplacesupplier.h> + +QT_BEGIN_NAMESPACE + +namespace { + +bool convertToGadget(const QMetaObject &metaObject, const QVariantMap &map, void *gadget) +{ + for (auto &&[key, value] : map.asKeyValueRange()) { + const int propIndex = metaObject.indexOfProperty(key.toUtf8()); + if (propIndex == -1) { + qCritical("No property %s in %s", qPrintable(key), metaObject.className()); + return false; + } + const QMetaProperty prop = metaObject.property(propIndex); + bool successfulWrite = false; + if (value.metaType() != prop.metaType()) { + QVariant coercedValue = value; + if (!coercedValue.convert(prop.metaType())) { + qCritical("Could not convert value from %s to %s for property %s::%s", + value.typeName(), prop.typeName(), metaObject.className(), qPrintable(key)); + return false; + } + successfulWrite = prop.writeOnGadget(gadget, coercedValue); + } else { + successfulWrite = prop.writeOnGadget(gadget, value); + } + if (!successfulWrite) { + qCritical("Could not set property %s on %s", qPrintable(key), metaObject.className()); + return false; + } + } + return true; +} + +template<typename SourceType, typename GadgetType> +bool converterToGadget(const void *src, void *gadget) +{ + const QMetaObject &metaObject = GadgetType::staticMetaObject; + QVariantMap variantMap; + if constexpr (std::is_same_v<SourceType, QJSValue>) { + const QJSValue &jsValue = *static_cast<const QJSValue *>(src); + const QVariant &variant = jsValue.toVariant(); + if (variant.metaType() != QMetaType::fromType<QVariantMap>()) + return false; + variantMap = variant.toMap(); + } else { + static_assert(std::is_same_v<SourceType, QVariantMap>); + variantMap = *static_cast<const QVariantMap *>(src); + } + return convertToGadget(metaObject, variantMap, gadget); +} + +template<typename GadgetType> +bool registerConverterToGadget() +{ + if (!QMetaType::registerConverterFunction(converterToGadget<QJSValue, GadgetType>, + QMetaType::fromType<QJSValue>(), QMetaType::fromType<GadgetType>())) { + qCritical("Failed to register conversion function from QJSValue to %s", + GadgetType::staticMetaObject.className()); + return false; + } + if (!QMetaType::registerConverterFunction(converterToGadget<QVariantMap, GadgetType>, + QMetaType::fromType<QVariantMap>(), QMetaType::fromType<GadgetType>())) { + qCritical("Failed to register conversion function from QVariantMap to %s", + GadgetType::staticMetaObject.className()); + return false; + } + + return true; +} + +} // anonymous namespace + +void registerConverters() +{ + registerConverterToGadget<QPlaceRatings>(); + registerConverterToGadget<QPlaceIcon>(); + registerConverterToGadget<QPlaceSupplier>(); +} + +Q_CONSTRUCTOR_FUNCTION(registerConverters); + + + +QT_END_NAMESPACE diff --git a/src/location/quickmapitems/qdeclarativecirclemapitem_p.h b/src/location/quickmapitems/qdeclarativecirclemapitem_p.h index fbbe39a7..9e5f4e1a 100644 --- a/src/location/quickmapitems/qdeclarativecirclemapitem_p.h +++ b/src/location/quickmapitems/qdeclarativecirclemapitem_p.h @@ -64,13 +64,15 @@ class QDeclarativeCircleMapItemPrivate; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeCircleMapItem : public QDeclarativeGeoMapItemBase { Q_OBJECT + QML_NAMED_ELEMENT(MapCircle) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Backend) Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter NOTIFY centerChanged) Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT) - Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION 15) + Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15)) public: enum Backend { diff --git a/src/location/quickmapitems/qdeclarativegeomap_p.h b/src/location/quickmapitems/qdeclarativegeomap_p.h index 3d4fc511..7875b3fd 100644 --- a/src/location/quickmapitems/qdeclarativegeomap_p.h +++ b/src/location/quickmapitems/qdeclarativegeomap_p.h @@ -78,6 +78,8 @@ class QDeclarativeGeoMapParameter; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMap : public QQuickItem { Q_OBJECT + QML_NAMED_ELEMENT(Map) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(QGeoServiceProvider::Error) Q_PROPERTY(QQuickGeoMapGestureArea *gesture READ gesture CONSTANT) Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged) @@ -106,7 +108,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMap : public QQuickItem Q_PROPERTY(bool copyrightsVisible READ copyrightsVisible WRITE setCopyrightsVisible NOTIFY copyrightsVisibleChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(bool mapReady READ mapReady NOTIFY mapReadyChanged) - Q_PROPERTY(QRectF visibleArea READ visibleArea WRITE setVisibleArea NOTIFY visibleAreaChanged REVISION 12) + Q_PROPERTY(QRectF visibleArea READ visibleArea WRITE setVisibleArea NOTIFY visibleAreaChanged REVISION(5, 12)) Q_INTERFACES(QQmlParserStatus) public: diff --git a/src/location/quickmapitems/qdeclarativegeomapcopyrightsnotice_p.h b/src/location/quickmapitems/qdeclarativegeomapcopyrightsnotice_p.h index 7e4c9957..9b1634e3 100644 --- a/src/location/quickmapitems/qdeclarativegeomapcopyrightsnotice_p.h +++ b/src/location/quickmapitems/qdeclarativegeomapcopyrightsnotice_p.h @@ -69,6 +69,9 @@ class QDeclarativeGeoMapCopyrightNoticePrivate; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapCopyrightNotice : public QQuickPaintedItem { Q_OBJECT + QML_NAMED_ELEMENT(MapCopyrightNotice) + QML_ADDED_IN_VERSION(5, 0) + Q_PROPERTY(QDeclarativeGeoMap *mapSource READ mapSource WRITE setMapSource NOTIFY mapSourceChanged) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet NOTIFY styleSheetChanged) diff --git a/src/location/quickmapitems/qdeclarativegeomapitembase.cpp b/src/location/quickmapitems/qdeclarativegeomapitembase.cpp index 3767351c..1d75cec4 100644 --- a/src/location/quickmapitems/qdeclarativegeomapitembase.cpp +++ b/src/location/quickmapitems/qdeclarativegeomapitembase.cpp @@ -294,11 +294,6 @@ QSGNode *QDeclarativeGeoMapItemBase::updateMapItemPaintNode(QSGNode *oldNode, Up return nullptr; } -QGeoMap::ItemType QDeclarativeGeoMapItemBase::itemType() const -{ - return m_itemType; -} - /*! \internal diff --git a/src/location/quickmapitems/qdeclarativegeomapitembase_p.h b/src/location/quickmapitems/qdeclarativegeomapitembase_p.h index 8031a204..315a8c89 100644 --- a/src/location/quickmapitems/qdeclarativegeomapitembase_p.h +++ b/src/location/quickmapitems/qdeclarativegeomapitembase_p.h @@ -80,10 +80,13 @@ struct Q_LOCATION_PRIVATE_EXPORT QGeoMapViewportChangeEvent class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapItemBase : public QQuickItem { Q_OBJECT + QML_NAMED_ELEMENT(GeoMapItemBase) + QML_ADDED_IN_VERSION(5, 0) + QML_UNCREATABLE("GeoMapItemBase is not intended instantiable by developer.") Q_PROPERTY(QGeoShape geoShape READ geoShape WRITE setGeoShape STORED false ) - Q_PROPERTY(bool autoFadeIn READ autoFadeIn WRITE setAutoFadeIn REVISION 14) - Q_PROPERTY(int lodThreshold READ lodThreshold WRITE setLodThreshold NOTIFY lodThresholdChanged REVISION 15) + Q_PROPERTY(bool autoFadeIn READ autoFadeIn WRITE setAutoFadeIn REVISION(5, 14)) + Q_PROPERTY(int lodThreshold READ lodThreshold WRITE setLodThreshold NOTIFY lodThresholdChanged REVISION(5, 15)) public: explicit QDeclarativeGeoMapItemBase(QQuickItem *parent = nullptr); @@ -107,13 +110,12 @@ public: QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; virtual QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *); - QGeoMap::ItemType itemType() const; + inline QGeoMap::ItemType itemType() const { return m_itemType; } qreal mapItemOpacity() const; void setParentGroup(QDeclarativeGeoMapItemGroup &parentGroup); template <typename T = QObject> - QList<T*> quickChildren() const { QList<T*> res; diff --git a/src/location/quickmapitems/qdeclarativegeomapitemgroup_p.h b/src/location/quickmapitems/qdeclarativegeomapitemgroup_p.h index c3e997ad..3883b247 100644 --- a/src/location/quickmapitems/qdeclarativegeomapitemgroup_p.h +++ b/src/location/quickmapitems/qdeclarativegeomapitemgroup_p.h @@ -61,6 +61,9 @@ class QDeclarativeGeoMap; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapItemGroup : public QQuickItem { Q_OBJECT + QML_NAMED_ELEMENT(MapItemGroup) + QML_ADDED_IN_VERSION(5, 0) + public: explicit QDeclarativeGeoMapItemGroup(QQuickItem *parent = nullptr); virtual ~QDeclarativeGeoMapItemGroup(); diff --git a/src/location/quickmapitems/qdeclarativegeomapitemview_p.h b/src/location/quickmapitems/qdeclarativegeomapitemview_p.h index 25c54d48..925df000 100644 --- a/src/location/quickmapitems/qdeclarativegeomapitemview_p.h +++ b/src/location/quickmapitems/qdeclarativegeomapitemview_p.h @@ -80,14 +80,15 @@ class QDeclarativeGeoMapItemGroup; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapItemView : public QDeclarativeGeoMapItemGroup { Q_OBJECT - + QML_NAMED_ELEMENT(MapItemView) + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(bool autoFitViewport READ autoFitViewport WRITE setAutoFitViewport NOTIFY autoFitViewportChanged) - Q_PROPERTY(QQuickTransition *add MEMBER m_enter REVISION 12) - Q_PROPERTY(QQuickTransition *remove MEMBER m_exit REVISION 12) - Q_PROPERTY(QList<QQuickItem *> mapItems READ mapItems REVISION 12) - Q_PROPERTY(bool incubateDelegates READ incubateDelegates WRITE setIncubateDelegates NOTIFY incubateDelegatesChanged REVISION 12) + Q_PROPERTY(QQuickTransition *add MEMBER m_enter REVISION(5, 12)) + Q_PROPERTY(QQuickTransition *remove MEMBER m_exit REVISION(5, 12)) + Q_PROPERTY(QList<QQuickItem *> mapItems READ mapItems REVISION(5, 12)) + Q_PROPERTY(bool incubateDelegates READ incubateDelegates WRITE setIncubateDelegates NOTIFY incubateDelegatesChanged REVISION(5, 12)) public: explicit QDeclarativeGeoMapItemView(QQuickItem *parent = nullptr); diff --git a/src/location/quickmapitems/qdeclarativegeomapquickitem_p.h b/src/location/quickmapitems/qdeclarativegeomapquickitem_p.h index b8e093af..e0d32d7d 100644 --- a/src/location/quickmapitems/qdeclarativegeomapquickitem_p.h +++ b/src/location/quickmapitems/qdeclarativegeomapquickitem_p.h @@ -76,6 +76,8 @@ public: class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapQuickItem : public QDeclarativeGeoMapItemBase { Q_OBJECT + QML_NAMED_ELEMENT(MapQuickItem) + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged) Q_PROPERTY(QPointF anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged) Q_PROPERTY(qreal zoomLevel READ zoomLevel WRITE setZoomLevel NOTIFY zoomLevelChanged) diff --git a/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h b/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h index d388c007..fae9c626 100644 --- a/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h +++ b/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h @@ -62,12 +62,14 @@ class QDeclarativePolygonMapItemPrivate; class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolygonMapItem : public QDeclarativeGeoMapItemBase { Q_OBJECT + QML_NAMED_ELEMENT(MapPolygon) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Backend) Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT) - Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION 15) + Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15)) public: enum Backend { diff --git a/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h b/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h index bd7cc9a2..e5446d7b 100644 --- a/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h +++ b/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h @@ -66,6 +66,8 @@ QT_BEGIN_NAMESPACE class Q_LOCATION_PRIVATE_EXPORT QDeclarativeMapLineProperties : public QObject { Q_OBJECT + QML_ELEMENT + QML_ANONYMOUS Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) @@ -92,11 +94,13 @@ class QDeclarativePolylineMapItemPrivate; class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolylineMapItem : public QDeclarativeGeoMapItemBase { Q_OBJECT + QML_NAMED_ELEMENT(MapPolyline) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Backend) Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(QDeclarativeMapLineProperties *line READ line CONSTANT) - Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION 15) + Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15)) public: enum Backend { diff --git a/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h b/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h index 968b9f21..066ba241 100644 --- a/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h +++ b/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h @@ -67,13 +67,15 @@ class QDeclarativeRectangleMapItemPrivate; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeRectangleMapItem: public QDeclarativeGeoMapItemBase { Q_OBJECT + QML_NAMED_ELEMENT(MapRectangle) + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(Backend) Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft NOTIFY topLeftChanged) Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight NOTIFY bottomRightChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT) - Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION 15) + Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15)) public: enum Backend { diff --git a/src/location/quickmapitems/qdeclarativeroutemapitem_p.h b/src/location/quickmapitems/qdeclarativeroutemapitem_p.h index 94cc844a..df9e982f 100644 --- a/src/location/quickmapitems/qdeclarativeroutemapitem_p.h +++ b/src/location/quickmapitems/qdeclarativeroutemapitem_p.h @@ -67,6 +67,8 @@ class QDeclarativeGeoRoute; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeRouteMapItem : public QDeclarativePolylineMapItem { Q_OBJECT + QML_NAMED_ELEMENT(MapRoute) + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QDeclarativeGeoRoute *route READ route WRITE setRoute NOTIFY routeChanged) diff --git a/src/location/quickmapitems/qquickgeomapgesturearea_p.h b/src/location/quickmapitems/qquickgeomapgesturearea_p.h index e8735761..86bd3537 100644 --- a/src/location/quickmapitems/qquickgeomapgesturearea_p.h +++ b/src/location/quickmapitems/qquickgeomapgesturearea_p.h @@ -73,6 +73,9 @@ class QGeoMap; class Q_LOCATION_PRIVATE_EXPORT QGeoMapPinchEvent : public QObject { Q_OBJECT + QML_NAMED_ELEMENT(MapPinchEvent) + QML_UNCREATABLE("(Map)PinchEvent is not intended instantiable by developer.") + QML_ADDED_IN_VERSION(5, 0) Q_PROPERTY(QPointF center READ center) Q_PROPERTY(qreal angle READ angle) @@ -116,6 +119,9 @@ private: class Q_LOCATION_PRIVATE_EXPORT QQuickGeoMapGestureArea: public QQuickItem { Q_OBJECT + QML_NAMED_ELEMENT(MapGestureArea) + QML_UNCREATABLE("(Map)GestureArea is not intended instantiable by developer.") + QML_ADDED_IN_VERSION(5, 0) Q_ENUMS(GeoMapGesture) Q_FLAGS(AcceptedGestures) @@ -127,7 +133,7 @@ class Q_LOCATION_PRIVATE_EXPORT QQuickGeoMapGestureArea: public QQuickItem Q_PROPERTY(AcceptedGestures acceptedGestures READ acceptedGestures WRITE setAcceptedGestures NOTIFY acceptedGesturesChanged) Q_PROPERTY(qreal maximumZoomLevelChange READ maximumZoomLevelChange WRITE setMaximumZoomLevelChange NOTIFY maximumZoomLevelChangeChanged) Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged) - Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1) + Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION(5, 1)) public: QQuickGeoMapGestureArea(QDeclarativeGeoMap *map); |