summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeoroute_p.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-03 17:58:00 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-09 12:33:20 +0200
commita353464c39de1ffe08147b5374d1a3c16e4d4e03 (patch)
tree2758a1b167ce6c05ed5e06cbf4b69ad0712a7db7 /src/location/declarativemaps/qdeclarativegeoroute_p.h
parentb6d3431ba621a1aabfd7d1ea3326bf503428a634 (diff)
downloadqtlocation-a353464c39de1ffe08147b5374d1a3c16e4d4e03.tar.gz
Make QDeclarativeGeoRoute::legs type safe
We can use a QList property with a forward-declared type, so do that instead of using QList<QObject *>. Pick-to: 6.2 Change-Id: I20d8ebbf4aa2d9ca18ae0ce7b3e6b2698dd069f2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeoroute_p.h')
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroute_p.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h
index a43e9d4d..38a0570f 100644
--- a/src/location/declarativemaps/qdeclarativegeoroute_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h
@@ -64,6 +64,7 @@ Q_MOC_INCLUDE(<QtLocation/private/qdeclarativegeoroutemodel_p.h>)
QT_BEGIN_NAMESPACE
class QDeclarativeGeoRouteQuery;
+class QDeclarativeGeoRouteLeg;
class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRoute : public QObject
{
@@ -75,7 +76,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRoute : public QObject
Q_PROPERTY(QJSValue 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<QObject *> legs READ legs CONSTANT REVISION 12)
+ Q_PROPERTY(QList<QDeclarativeGeoRouteLeg *> legs READ legs CONSTANT REVISION 12)
Q_PROPERTY(QObject *extendedAttributes READ extendedAttributes CONSTANT REVISION 13)
public:
@@ -98,7 +99,7 @@ public:
int segmentsCount() const;
const QGeoRoute &route() const;
QDeclarativeGeoRouteQuery *routeQuery();
- QList<QObject *> legs();
+ QList<QDeclarativeGeoRouteLeg *> legs();
QQmlPropertyMap *extendedAttributes() const;
Q_INVOKABLE bool equals(QDeclarativeGeoRoute *other) const;
@@ -112,7 +113,7 @@ private:
QGeoRoute route_;
QDeclarativeGeoRouteQuery *routeQuery_ = nullptr;
QList<QGeoRouteSegment> segments_;
- QList<QObject *> legs_;
+ QList<QDeclarativeGeoRouteLeg *> legs_;
QQmlPropertyMap *m_extendedAttributes = nullptr;
friend class QDeclarativeRouteMapItem;