summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeoroute_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-07-25 17:11:32 +0200
committerBogDan Vatra <bogdan@kdab.com>2017-08-24 12:16:32 +0000
commit8ac6377e62af803b567449cdf30c669b92114cc4 (patch)
tree0a8d9d797df2dbc32524f28510712f2ceacde764 /src/location/declarativemaps/qdeclarativegeoroute_p.h
parent2dc1acb63777c983cfc4cbdbd2176a8dab112209 (diff)
downloadqtlocation-8ac6377e62af803b567449cdf30c669b92114cc4.tar.gz
Make QGeoRoute extensible
This change makes it possible to subclass QGeoRoute, QGeoRouteSegment or QGeoRouteManeuver, with custom private implementations. It also attempts to minimize the cost that creating a QDeclarativeGeoRoute currently has, by deferring the initialization of QDeclarativeGeoRoute::segments_ to the first access, and also populating the list only to the requested point. Change-Id: I4c87391bcc380ddca6523c748ebb97d2a44ed9d2 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeoroute_p.h')
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroute_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h
index e4501770..738d2089 100644
--- a/src/location/declarativemaps/qdeclarativegeoroute_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h
@@ -84,6 +84,8 @@ public:
void appendSegment(QDeclarativeGeoRouteSegment *segment);
void clearSegments();
+ int segmentsCount() const;
+
Q_SIGNALS:
void pathChanged();
@@ -93,11 +95,12 @@ private:
static QDeclarativeGeoRouteSegment *segments_at(QQmlListProperty<QDeclarativeGeoRouteSegment> *prop, int index);
static void segments_clear(QQmlListProperty<QDeclarativeGeoRouteSegment> *prop);
- void init();
+ void initSegments(unsigned int lastIndex = -1);
QList<QGeoCoordinate> routePath();
QGeoRoute route_;
QList<QDeclarativeGeoRouteSegment *> segments_;
+ bool segmentsDirty_;
friend class QDeclarativeRouteMapItem;
};