summaryrefslogtreecommitdiff
path: root/src/location/maps
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-01-12 18:22:49 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-01-24 12:45:15 +0000
commit05f635b24a9a290beae8eac2ade5ab77ade45b38 (patch)
treedd3777c983702f059a81e59b76d9d26ac72b42c4 /src/location/maps
parenteb8a6480201e6594ef07affda616892ea1824c24 (diff)
downloadqtlocation-05f635b24a9a290beae8eac2ade5ab77ade45b38.tar.gz
Allow to extract pimpl from QGeoRoute
Needed to properly implement Navigators, which only get QGeoRoutes, and may find easier to directly access the private implementation rather than going through the routeId. Change-Id: I6c23d7b5336d1fb99fad3cf588cbf78437e0563f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location/maps')
-rw-r--r--src/location/maps/qgeoroute.cpp5
-rw-r--r--src/location/maps/qgeoroute.h1
-rw-r--r--src/location/maps/qgeoroute_p.h2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/location/maps/qgeoroute.cpp b/src/location/maps/qgeoroute.cpp
index 2e7b259a..d2f6fb51 100644
--- a/src/location/maps/qgeoroute.cpp
+++ b/src/location/maps/qgeoroute.cpp
@@ -414,6 +414,11 @@ QGeoRouteSegment QGeoRoutePrivate::firstSegment() const
return QGeoRouteSegment();
}
+const QGeoRoutePrivate *QGeoRoutePrivate::routePrivateData(const QGeoRoute &route)
+{
+ return route.d_ptr.data();
+}
+
/*******************************************************************************
*******************************************************************************/
diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h
index 7dee719f..de319b4c 100644
--- a/src/location/maps/qgeoroute.h
+++ b/src/location/maps/qgeoroute.h
@@ -91,6 +91,7 @@ protected:
QGeoRoute(const QExplicitlySharedDataPointer<QGeoRoutePrivate> &dd);
QExplicitlySharedDataPointer<QGeoRoutePrivate> d_ptr;
friend class QDeclarativeGeoRoute;
+ friend class QGeoRoutePrivate;
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h
index 26eb613c..d56b2d44 100644
--- a/src/location/maps/qgeoroute_p.h
+++ b/src/location/maps/qgeoroute_p.h
@@ -97,6 +97,8 @@ public:
virtual QString engineName() const = 0;
virtual int segmentsCount() const = 0;
+ static const QGeoRoutePrivate *routePrivateData(const QGeoRoute &route);
+
protected:
virtual bool equals(const QGeoRoutePrivate &other) const;
};