diff options
Diffstat (limited to 'src/location/maps')
-rw-r--r-- | src/location/maps/qgeocodereply.cpp | 22 | ||||
-rw-r--r-- | src/location/maps/qgeocodereply.h | 2 | ||||
-rw-r--r-- | src/location/maps/qgeocodereply_p.h | 10 | ||||
-rw-r--r-- | src/location/maps/qgeomap.cpp | 3 | ||||
-rw-r--r-- | src/location/maps/qgeomap_p.h | 2 | ||||
-rw-r--r-- | src/location/maps/qgeoroute.cpp | 48 | ||||
-rw-r--r-- | src/location/maps/qgeoroute.h | 3 | ||||
-rw-r--r-- | src/location/maps/qgeoroute_p.h | 8 | ||||
-rw-r--r-- | src/location/maps/qgeotilerequestmanager.cpp | 4 | ||||
-rw-r--r-- | src/location/maps/qnavigationmanagerengine_p.h | 8 |
10 files changed, 101 insertions, 9 deletions
diff --git a/src/location/maps/qgeocodereply.cpp b/src/location/maps/qgeocodereply.cpp index 5fefb6fe..9fbede9c 100644 --- a/src/location/maps/qgeocodereply.cpp +++ b/src/location/maps/qgeocodereply.cpp @@ -97,6 +97,13 @@ QGeoCodeReply::QGeoCodeReply(QObject *parent) : QObject(parent), d_ptr(new QGeoCodeReplyPrivate()) {} +QGeoCodeReply::QGeoCodeReply(QGeoCodeReplyPrivate &dd, QObject *parent) + : QObject(parent), + d_ptr(&dd) +{ + +} + /*! Constructs a geocode reply with a given \a error and \a errorString and the specified \a parent. */ @@ -335,4 +342,19 @@ QGeoCodeReplyPrivate::QGeoCodeReplyPrivate(QGeoCodeReply::Error error, const QSt QGeoCodeReplyPrivate::~QGeoCodeReplyPrivate() {} +QVariantMap QGeoCodeReplyPrivate::extraData() const +{ + return QVariantMap(); +} + +const QGeoCodeReplyPrivate *QGeoCodeReplyPrivate::get(const QGeoCodeReply &reply) +{ + return reply.d_ptr; +} + +QGeoCodeReplyPrivate *QGeoCodeReplyPrivate::get(QGeoCodeReply &reply) +{ + return reply.d_ptr; +} + QT_END_NAMESPACE diff --git a/src/location/maps/qgeocodereply.h b/src/location/maps/qgeocodereply.h index c41e740d..c2395f10 100644 --- a/src/location/maps/qgeocodereply.h +++ b/src/location/maps/qgeocodereply.h @@ -85,6 +85,7 @@ Q_SIGNALS: protected: explicit QGeoCodeReply(QObject *parent = nullptr); + explicit QGeoCodeReply(QGeoCodeReplyPrivate &dd, QObject *parent = nullptr); void setError(Error error, const QString &errorString); void setFinished(bool finished); @@ -99,6 +100,7 @@ protected: private: QGeoCodeReplyPrivate *d_ptr; Q_DISABLE_COPY(QGeoCodeReply) + friend class QGeoCodeReplyPrivate; }; QT_END_NAMESPACE diff --git a/src/location/maps/qgeocodereply_p.h b/src/location/maps/qgeocodereply_p.h index fefe7883..3f77497b 100644 --- a/src/location/maps/qgeocodereply_p.h +++ b/src/location/maps/qgeocodereply_p.h @@ -48,22 +48,28 @@ // We mean it. // +#include <QtLocation/private/qlocationglobal_p.h> #include "qgeocodereply.h" #include "qgeoshape.h" #include <QList> +#include <QVariantMap> QT_BEGIN_NAMESPACE class QGeoLocation; -class QGeoCodeReplyPrivate +class Q_LOCATION_PRIVATE_EXPORT QGeoCodeReplyPrivate { public: QGeoCodeReplyPrivate(); QGeoCodeReplyPrivate(QGeoCodeReply::Error error, const QString &errorString); - ~QGeoCodeReplyPrivate(); + virtual ~QGeoCodeReplyPrivate(); + + virtual QVariantMap extraData() const; + static const QGeoCodeReplyPrivate *get(const QGeoCodeReply &reply); + static QGeoCodeReplyPrivate *get(QGeoCodeReply &reply); QGeoCodeReply::Error error; QString errorString; diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp index 963ef6bd..bf5e557d 100644 --- a/src/location/maps/qgeomap.cpp +++ b/src/location/maps/qgeomap.cpp @@ -135,9 +135,10 @@ bool QGeoMap::anchorCoordinateToPoint(const QGeoCoordinate &coordinate, const QP return false; } -bool QGeoMap::fitViewportToGeoRectangle(const QGeoRectangle &rectangle) +bool QGeoMap::fitViewportToGeoRectangle(const QGeoRectangle &rectangle, const QMargins &borders) { Q_UNUSED(rectangle) + Q_UNUSED(borders) return false; } diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h index 874b300f..c0af9e10 100644 --- a/src/location/maps/qgeomap_p.h +++ b/src/location/maps/qgeomap_p.h @@ -150,7 +150,7 @@ public: virtual bool setBearing(qreal bearing, const QGeoCoordinate &coordinate); virtual QGeoShape visibleRegion() const; virtual bool anchorCoordinateToPoint(const QGeoCoordinate &coordinate, const QPointF &anchorPoint); - virtual bool fitViewportToGeoRectangle(const QGeoRectangle &rectangle); + virtual bool fitViewportToGeoRectangle(const QGeoRectangle &rectangle, const QMargins &borders); virtual void setCopyrightVisible(bool visible); virtual void removeMapObject(QGeoMapObject *obj); diff --git a/src/location/maps/qgeoroute.cpp b/src/location/maps/qgeoroute.cpp index 799fe7f1..ef54e4aa 100644 --- a/src/location/maps/qgeoroute.cpp +++ b/src/location/maps/qgeoroute.cpp @@ -321,6 +321,26 @@ QList<QGeoRouteLeg> QGeoRoute::routeLegs() const return d_ptr->routeLegs(); } +/*! + Sets the extended attributes \a extendedAttributes associated with this route. + + \since 5.13 +*/ +void QGeoRoute::setExtendedAttributes(const QVariantMap &extendedAttributes) +{ + d_ptr->setExtendedAttributes(extendedAttributes); +} + +/*! + Returns the extended attributes associated with this route. + + \since 5.13 +*/ +QVariantMap QGeoRoute::extendedAttributes() const +{ + return d_ptr->extendedAttributes(); +} + /******************************************************************************* *******************************************************************************/ @@ -361,7 +381,7 @@ bool QGeoRoutePrivate::equals(const QGeoRoutePrivate &other) const s2 = s2.nextRouteSegment(); } - return ((id() == other.id()) + return ( (id() == other.id()) && (request() == other.request()) && (bounds() == other.bounds()) && (travelTime() == other.travelTime()) @@ -369,7 +389,8 @@ bool QGeoRoutePrivate::equals(const QGeoRoutePrivate &other) const && (travelMode() == other.travelMode()) && (path() == other.path()) && (metadata() == other.metadata()) - && (routeLegs() == other.routeLegs())); + && (routeLegs() == other.routeLegs()) + && (extendedAttributes() == other.extendedAttributes()) ); } void QGeoRoutePrivate::setId(const QString &id) @@ -472,6 +493,16 @@ QList<QGeoRouteLeg> QGeoRoutePrivate::routeLegs() const return QList<QGeoRouteLeg>(); } +void QGeoRoutePrivate::setExtendedAttributes(const QVariantMap &/*extendedAttributes*/) +{ + +} + +QVariantMap QGeoRoutePrivate::extendedAttributes() const +{ + return QVariantMap(); +} + void QGeoRoutePrivate::setLegIndex(int /*idx*/) { @@ -514,7 +545,8 @@ QGeoRoutePrivateDefault::QGeoRoutePrivateDefault(const QGeoRoutePrivateDefault & m_path(other.m_path), m_legs(other.m_legs), m_firstSegment(other.m_firstSegment), - m_numSegments(other.m_numSegments){} + m_numSegments(other.m_numSegments), + m_extendedAttributes(other.m_extendedAttributes) {} // Purposedly ignoring legIndex and parentRoute QGeoRoutePrivateDefault::~QGeoRoutePrivateDefault() {} @@ -636,6 +668,16 @@ QList<QGeoRouteLeg> QGeoRoutePrivateDefault::routeLegs() const return m_legs; } +void QGeoRoutePrivateDefault::setExtendedAttributes(const QVariantMap &extendedAttributes) +{ + m_extendedAttributes = extendedAttributes; +} + +QVariantMap QGeoRoutePrivateDefault::extendedAttributes() const +{ + return m_extendedAttributes; +} + void QGeoRoutePrivateDefault::setLegIndex(int idx) { if (idx >= 0) diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h index 381152e3..363ca61b 100644 --- a/src/location/maps/qgeoroute.h +++ b/src/location/maps/qgeoroute.h @@ -90,6 +90,9 @@ public: void setRouteLegs(const QList<QGeoRouteLeg> &legs); QList<QGeoRouteLeg> routeLegs() const; + void setExtendedAttributes(const QVariantMap &extendedAttributes); + QVariantMap extendedAttributes() const; + protected: QGeoRoute(const QExplicitlySharedDataPointer<QGeoRoutePrivate> &dd); QExplicitlySharedDataPointer<QGeoRoutePrivate> &d(); diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h index 39f96c48..721d00b9 100644 --- a/src/location/maps/qgeoroute_p.h +++ b/src/location/maps/qgeoroute_p.h @@ -55,6 +55,7 @@ #include "qgeoroutesegment.h" #include <QSharedData> +#include <QVariantMap> #include <QScopedPointer> QT_BEGIN_NAMESPACE @@ -100,6 +101,9 @@ public: virtual void setRouteLegs(const QList<QGeoRouteLeg> &legs); virtual QList<QGeoRouteLeg> routeLegs() const; + virtual void setExtendedAttributes(const QVariantMap &extendedAttributes); + virtual QVariantMap extendedAttributes() const; + virtual QString engineName() const = 0; virtual int segmentsCount() const = 0; @@ -153,6 +157,9 @@ public: virtual void setRouteLegs(const QList<QGeoRouteLeg> &legs) override; virtual QList<QGeoRouteLeg> routeLegs() const override; + void setExtendedAttributes(const QVariantMap &extendedAttributes) override; + QVariantMap extendedAttributes() const override; + // QGeoRouteLeg API virtual void setLegIndex(int idx) override; virtual int legIndex() const override; @@ -175,6 +182,7 @@ public: QGeoRouteSegment m_firstSegment; mutable int m_numSegments; QScopedPointer<QGeoRoute> m_containingRoute; + QVariantMap m_extendedAttributes; int m_legIndex = 0; }; diff --git a/src/location/maps/qgeotilerequestmanager.cpp b/src/location/maps/qgeotilerequestmanager.cpp index d4d94ad0..aa6de94d 100644 --- a/src/location/maps/qgeotilerequestmanager.cpp +++ b/src/location/maps/qgeotilerequestmanager.cpp @@ -240,6 +240,6 @@ void QGeoTileRequestManagerPrivate::tileError(const QGeoTileSpec &tile, const QS } } -#include "qgeotilerequestmanager.moc" - QT_END_NAMESPACE + +#include "qgeotilerequestmanager.moc" diff --git a/src/location/maps/qnavigationmanagerengine_p.h b/src/location/maps/qnavigationmanagerengine_p.h index 0852b3ea..e7b3876c 100644 --- a/src/location/maps/qnavigationmanagerengine_p.h +++ b/src/location/maps/qnavigationmanagerengine_p.h @@ -60,11 +60,18 @@ class QGeoMap; class QGeoMapParameter; class QMapRouteObject; class QGeoRoute; +class QGeoRouteLeg; class QNavigationManager; class QNavigationManagerEnginePrivate; class QDeclarativeNavigatorParams; class QDeclarativeGeoWaypoint; +/* + This class is not supposed to react on QDeclarativeNavigator properties changes. + This class is meant to react only on start, stop and setTrackPosition. + Upon start(), it is supposed to fetch all info from the QDeclarativeNavigatorParams that the engine is supposed + to inject. +*/ class Q_LOCATION_PRIVATE_EXPORT QAbstractNavigator: public QObject { Q_OBJECT @@ -89,6 +96,7 @@ signals: void waypointReached(const QDeclarativeGeoWaypoint *pos); void destinationReached(); void currentRouteChanged(const QGeoRoute &route); + void currentRouteLegChanged(const QGeoRouteLeg &route); void currentSegmentChanged(int segment); private: |