diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2012-08-16 13:32:43 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-28 10:07:49 +0200 |
commit | 059388adce26be48868cd741b4c5d751298fb4d8 (patch) | |
tree | 1a8a41c0f280b7ab3c502b49527bd609d1c0884a /src/imports/location/qdeclarativegeoroutemodel_p.h | |
parent | 7dd46f8c96a4bdaca2809ff97b773f358392516f (diff) |
Convert GeoShape, GeoRectangle and GeoCircle into QML value types.v5.0.0-beta1
This replaces the GeoShape, GeoRectangle and GeoCircle QML elements with
value types. A value type is a better fit for shape types. It is very
similar to a rect with some utility functions.
Declare QGeoShape, QGeoRectangle and QGeoCircle as movable types.
Update documentation.
Change-Id: Id6c48e1e841c68f2f0c5c6a9c4a6580a57e2dfb6
Reviewed-by: abcd <amos.choy@nokia.com>
Diffstat (limited to 'src/imports/location/qdeclarativegeoroutemodel_p.h')
-rw-r--r-- | src/imports/location/qdeclarativegeoroutemodel_p.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/imports/location/qdeclarativegeoroutemodel_p.h b/src/imports/location/qdeclarativegeoroutemodel_p.h index 67aecf10..d296c560 100644 --- a/src/imports/location/qdeclarativegeoroutemodel_p.h +++ b/src/imports/location/qdeclarativegeoroutemodel_p.h @@ -190,7 +190,7 @@ class QDeclarativeGeoRouteQuery : public QObject, public QQmlParserStatus Q_PROPERTY(SegmentDetail segmentDetail READ segmentDetail WRITE setSegmentDetail NOTIFY segmentDetailChanged) Q_PROPERTY(ManeuverDetail maneuverDetail READ maneuverDetail WRITE setManeuverDetail NOTIFY maneuverDetailChanged) Q_PROPERTY(QJSValue waypoints READ waypoints WRITE setWaypoints NOTIFY waypointsChanged) - Q_PROPERTY(QQmlListProperty<QDeclarativeGeoRectangle> excludedAreas READ excludedAreas NOTIFY excludedAreasChanged) + Q_PROPERTY(QJSValue excludedAreas READ excludedAreas WRITE setExcludedAreas NOTIFY excludedAreasChanged) Q_PROPERTY(QList<int> featureTypes READ featureTypes NOTIFY featureTypesChanged) Q_INTERFACES(QQmlParserStatus) @@ -203,7 +203,7 @@ public: void classBegin() {} void componentComplete(); - QGeoRouteRequest &routeRequest(); + QGeoRouteRequest routeRequest() const; enum TravelMode { CarTravel = QGeoRouteRequest::CarTravel, @@ -267,14 +267,15 @@ public: void setWaypoints(const QJSValue &value); // READ functions for list properties - QQmlListProperty<QDeclarativeGeoRectangle> excludedAreas(); + QJSValue excludedAreas() const; + void setExcludedAreas(const QJSValue &value); Q_INVOKABLE void addWaypoint(const QGeoCoordinate &waypoint); Q_INVOKABLE void removeWaypoint(const QGeoCoordinate &waypoint); Q_INVOKABLE void clearWaypoints(); - Q_INVOKABLE void addExcludedArea(QDeclarativeGeoRectangle *area); - Q_INVOKABLE void removeExcludedArea(QDeclarativeGeoRectangle *area); + Q_INVOKABLE void addExcludedArea(const QGeoRectangle &area); + Q_INVOKABLE void removeExcludedArea(const QGeoRectangle &area); Q_INVOKABLE void clearExcludedAreas(); Q_INVOKABLE void setFeatureWeight(FeatureType featureType, FeatureWeight featureWeight); @@ -317,13 +318,6 @@ private Q_SLOTS: private: Q_INVOKABLE void doCoordinateChanged(); - static void exclusions_append(QQmlListProperty<QDeclarativeGeoRectangle> *prop, QDeclarativeGeoRectangle *area); - static int exclusions_count(QQmlListProperty<QDeclarativeGeoRectangle> *prop); - static QDeclarativeGeoRectangle *exclusions_at(QQmlListProperty<QDeclarativeGeoRectangle> *prop, int index); - static void exclusions_clear(QQmlListProperty<QDeclarativeGeoRectangle> *prop); - - QList<QDeclarativeGeoRectangle *> exclusions_; - QGeoRouteRequest request_; bool complete_; bool m_excludedAreaCoordinateChanged; |