diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-03-20 12:54:12 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-03-20 12:54:23 +0100 |
commit | 84453c169555c7b6d4c22d455c832150c653d3b0 (patch) | |
tree | 0f10ef42ef9119c98dab495412b173c1d0c5a8e9 /src | |
parent | a69c93dd84d6811818241b4ff7444a2383661b82 (diff) | |
parent | 1ced79ad7cc256eb82113e3419cb09926ceae9c3 (diff) | |
download | qtlocation-84453c169555c7b6d4c22d455c832150c653d3b0.tar.gz |
Merge remote-tracking branch 'origin/5.11' into wip/navigation
Change-Id: I558b3b2de394b946d70f484a19d0c1f7bef25515
Diffstat (limited to 'src')
24 files changed, 204 insertions, 32 deletions
diff --git a/src/imports/positioning/qquickgeocoordinateanimation.cpp b/src/imports/positioning/qquickgeocoordinateanimation.cpp index 41c1be1e..b00f187d 100644 --- a/src/imports/positioning/qquickgeocoordinateanimation.cpp +++ b/src/imports/positioning/qquickgeocoordinateanimation.cpp @@ -275,14 +275,14 @@ void QQuickGeoCoordinateAnimation::setDirection(QQuickGeoCoordinateAnimation::Di d->m_direction = direction; switch (direction) { case West: - d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&q_coordinateWestInterpolator); + d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void *>(&q_coordinateWestInterpolator)); break; case East: - d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&q_coordinateEastInterpolator); + d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void *>(&q_coordinateEastInterpolator)); break; case Shortest: default: - d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&q_coordinateShortestInterpolator); + d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void *>(&q_coordinateShortestInterpolator)); break; } emit directionChanged(); diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp index a1e34a30..68e61ee5 100644 --- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp @@ -484,9 +484,15 @@ QSGNode *QDeclarativeCircleMapItem::updateMapItemPaintNode(QSGNode *oldNode, Upd */ void QDeclarativeCircleMapItem::updatePolish() { - if (!map() || !circle_.isValid() - || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + return; + if (!circle_.isValid()) { + geometry_.clear(); + borderGeometry_.clear(); + setWidth(0); + setHeight(0); return; + } const QGeoProjectionWebMercator &p = static_cast<const QGeoProjectionWebMercator&>(map()->geoProjection()); QScopedValueRollback<bool> rollback(updatingGeometry_); diff --git a/src/location/declarativemaps/qdeclarativegeoroute.cpp b/src/location/declarativemaps/qdeclarativegeoroute.cpp index aab59dc2..816d0f39 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroute.cpp @@ -38,6 +38,7 @@ #include "locationvaluetypehelper_p.h" #include <QtLocation/private/qgeomap_p.h> #include <QtLocation/private/qgeoroute_p.h> +#include <QtLocation/private/qdeclarativegeoroutemodel_p.h> #include <QtQml/QQmlEngine> #include <QtQml/qqmlinfo.h> @@ -306,4 +307,18 @@ const QGeoRoute &QDeclarativeGeoRoute::route() const return route_; } +/*! + \qmlproperty RouteQuery routeQuery + + Returns the route query associated with this route. + + \since 5.11 +*/ +QDeclarativeGeoRouteQuery *QDeclarativeGeoRoute::routeQuery() +{ + if (!routeQuery_) + routeQuery_ = new QDeclarativeGeoRouteQuery(route_.request(), this); + return routeQuery_; +} + QT_END_NAMESPACE diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h index 2be3d3f1..5fe29862 100644 --- a/src/location/declarativemaps/qdeclarativegeoroute_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h @@ -56,6 +56,7 @@ #include <QtLocation/QGeoRoute> QT_BEGIN_NAMESPACE +class QDeclarativeGeoRouteQuery; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRoute : public QObject { @@ -66,6 +67,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRoute : public QObject Q_PROPERTY(qreal distance READ distance CONSTANT) Q_PROPERTY(QJSValue path READ path WRITE setPath NOTIFY pathChanged) Q_PROPERTY(QQmlListProperty<QDeclarativeGeoRouteSegment> segments READ segments CONSTANT) + Q_PROPERTY(QDeclarativeGeoRouteQuery *routeQuery READ routeQuery) public: explicit QDeclarativeGeoRoute(QObject *parent = 0); @@ -86,6 +88,7 @@ public: int segmentsCount() const; const QGeoRoute &route() const; + QDeclarativeGeoRouteQuery *routeQuery(); Q_SIGNALS: void pathChanged(); @@ -100,6 +103,7 @@ private: QList<QGeoCoordinate> routePath(); QGeoRoute route_; + QDeclarativeGeoRouteQuery *routeQuery_ = nullptr; QList<QDeclarativeGeoRouteSegment *> segments_; bool segmentsDirty_; friend class QDeclarativeRouteMapItem; diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp index 8066d917..add53854 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp @@ -752,6 +752,21 @@ QDeclarativeGeoRouteQuery::QDeclarativeGeoRouteQuery(QObject *parent) { } +QDeclarativeGeoRouteQuery::QDeclarativeGeoRouteQuery(const QGeoRouteRequest &request, QObject *parent) +: QObject(parent), request_(request), complete_(false), m_excludedAreaCoordinateChanged(false) +{ + // Extra params assumed to be already set in the request. + // Init waypoints + const QList<QGeoCoordinate> wpts = request_.waypoints(); + const QList<QVariantMap> meta = request_.waypointsMetadata(); + for (int i = 0; i < wpts.size(); ++i) { + QDeclarativeGeoWaypoint *w = new QDeclarativeGeoWaypoint(this); + w->setCoordinate(wpts.at(i)); + w->setMetadata(meta.at(i)); + m_waypoints << w; + } +} + QDeclarativeGeoRouteQuery::~QDeclarativeGeoRouteQuery() { } @@ -1442,7 +1457,7 @@ QGeoRouteRequest QDeclarativeGeoRouteQuery::routeRequest() m_extraParametersChanged = false; // Update extra params into request const QList<QDeclarativeGeoMapParameter *> params = quickChildren<QDeclarativeGeoMapParameter>(); - QMap<QString, QVariantMap> extraParameters; + QVariantMap extraParameters; for (const QDeclarativeGeoMapParameter *p: params) extraParameters[p->type()] = p->toVariantMap(); request_.setExtraParameters(extraParameters); @@ -1456,6 +1471,21 @@ QGeoRouteRequest QDeclarativeGeoRouteQuery::routeRequest() return request_; } + +/*! + \qmlproperty VariantMap extraParameters + + The route query extra parameters. This property is read only. If the query is + defined by the user, these can be set by using MapParameters. + If the route query comes from the engine via signals, the query is intended to be read-only. + + \since 5.11 +*/ +QVariantMap QDeclarativeGeoRouteQuery::extraParameters() +{ + return routeRequest().extraParameters(); +} + void QDeclarativeGeoRouteQuery::excludedAreaCoordinateChanged() { if (!m_excludedAreaCoordinateChanged) { @@ -1771,6 +1801,16 @@ void QDeclarativeGeoWaypoint::setBearing(qreal bearing) } } +/*! + \qmlproperty VariantMap metadata + + The waypoint metadata. This property is read only. If the waypoint is + defined by the user, these can be set by using MapParameters. + If the waypoint comes from the engine via signals, or as part of a read-only route query, + the waypoint is intended to be read-only. + + \since 5.11 +*/ QVariantMap QDeclarativeGeoWaypoint::metadata() { if (m_metadataChanged) { @@ -1787,6 +1827,15 @@ QVariantMap QDeclarativeGeoWaypoint::metadata() return m_metadata; } +// Used only by QDeclarativeGeoRouteRequest +void QDeclarativeGeoWaypoint::setMetadata(const QVariantMap &meta) +{ + m_metadata = meta; + if (m_metadata.contains(QStringLiteral("bearing")) && m_metadata.value(QStringLiteral("bearing")).canConvert<double>()) + m_bearing = m_metadata.value(QStringLiteral("bearing")).toDouble(); + m_metadataChanged = false; +} + void QDeclarativeGeoWaypoint::extraParameterChanged() { m_metadataChanged = true; diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h index 5d8d1803..64c1ebf8 100644 --- a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h +++ b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h @@ -200,8 +200,10 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoWaypoint : public QGeoCoordinateO Q_PROPERTY(bool isValid READ isValid STORED false) Q_PROPERTY(qreal bearing READ bearing WRITE setBearing NOTIFY bearingChanged) + Q_PROPERTY(QVariantMap metadata READ metadata) Q_PROPERTY(QQmlListProperty<QObject> quickChildren READ declarativeChildren DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "quickChildren") + Q_INTERFACES(QQmlParserStatus) public: QDeclarativeGeoWaypoint(QObject *parent = 0); @@ -236,6 +238,7 @@ public: } QVariantMap metadata(); + void setMetadata(const QVariantMap &meta); Q_SIGNALS: void completed(); @@ -292,6 +295,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRouteQuery : public QObject, publ Q_PROPERTY(QVariantList waypoints READ waypoints WRITE setWaypoints NOTIFY waypointsChanged) Q_PROPERTY(QJSValue excludedAreas READ excludedAreas WRITE setExcludedAreas NOTIFY excludedAreasChanged) Q_PROPERTY(QList<int> featureTypes READ featureTypes NOTIFY featureTypesChanged) + Q_PROPERTY(QVariantMap extraParameters READ extraParameters) Q_PROPERTY(QQmlListProperty<QObject> quickChildren READ declarativeChildren DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "quickChildren") Q_INTERFACES(QQmlParserStatus) @@ -299,6 +303,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRouteQuery : public QObject, publ public: explicit QDeclarativeGeoRouteQuery(QObject *parent = 0); + QDeclarativeGeoRouteQuery(const QGeoRouteRequest &request, QObject *parent = 0); // init from request. For instances intended to be read only ~QDeclarativeGeoRouteQuery(); // From QQmlParserStatus @@ -306,6 +311,7 @@ public: void componentComplete(); QGeoRouteRequest routeRequest(); + QVariantMap extraParameters(); enum TravelMode { CarTravel = QGeoRouteRequest::CarTravel, diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index 5eda137c..7493c962 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -500,9 +500,15 @@ QSGNode *QDeclarativePolygonMapItem::updateMapItemPaintNode(QSGNode *oldNode, Up */ void QDeclarativePolygonMapItem::updatePolish() { - if (!map() || geopath_.path().length() == 0 - || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + return; + if (geopath_.path().length() == 0) { // Possibly cleared + geometry_.clear(); + borderGeometry_.clear(); + setWidth(0); + setHeight(0); return; + } const QGeoProjectionWebMercator &p = static_cast<const QGeoProjectionWebMercator&>(map()->geoProjection()); QScopedValueRollback<bool> rollback(updatingGeometry_); diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index 90ed95e4..3b004dce 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -748,9 +748,14 @@ void QDeclarativePolylineMapItem::updateCache() */ void QDeclarativePolylineMapItem::updatePolish() { - if (!map() || geopath_.path().length() == 0 - || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + return; + if (geopath_.path().length() == 0) { // Possibly cleared + geometry_.clear(); + setWidth(0); + setHeight(0); return; + } QScopedValueRollback<bool> rollback(updatingGeometry_); updatingGeometry_ = true; diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp index 0206ac96..54706ad7 100644 --- a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp @@ -273,9 +273,15 @@ QSGNode *QDeclarativeRectangleMapItem::updateMapItemPaintNode(QSGNode *oldNode, */ void QDeclarativeRectangleMapItem::updatePolish() { - if (!map() || !topLeft().isValid() || !bottomRight().isValid() - || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) + if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator) return; + if (!topLeft().isValid() || !bottomRight().isValid()) { + geometry_.clear(); + borderGeometry_.clear(); + setWidth(0); + setHeight(0); + return; + } const QGeoProjectionWebMercator &p = static_cast<const QGeoProjectionWebMercator&>(map()->geoProjection()); diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp index 1703bcfa..43041da4 100644 --- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp +++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp @@ -1722,7 +1722,8 @@ void QQuickGeoMapGestureArea::panStateMachine() */ bool QQuickGeoMapGestureArea::canStartPan() { - if (m_allPoints.count() == 0 || (m_acceptedGestures & PanGesture) == 0) + if (m_allPoints.count() == 0 || (m_acceptedGestures & PanGesture) == 0 + || m_mousePoint->state() == Qt::TouchPointReleased) // mouseReleaseEvent handling does not clear m_mousePoint, only ungrabMouse does -- QTBUG-66534 return false; // Check if thresholds for normal panning are met. diff --git a/src/location/maps/qgeorouteparserosrmv5.cpp b/src/location/maps/qgeorouteparserosrmv5.cpp index 63610485..d2699689 100644 --- a/src/location/maps/qgeorouteparserosrmv5.cpp +++ b/src/location/maps/qgeorouteparserosrmv5.cpp @@ -836,7 +836,12 @@ static QGeoRouteSegment parseStep(const QJsonObject &step, bool useServerText) { geoManeuver.setWaypoint(coord); QVariantMap extraAttributes; - static const QStringList extras { "bearing_before", "bearing_after", "instruction", "type", "modifier" }; + static const QStringList extras { + QLatin1String("bearing_before"), + QLatin1String("bearing_after"), + QLatin1String("instruction"), + QLatin1String("type"), + QLatin1String("modifier") }; for (const QString &e: extras) { if (maneuver.find(e) != maneuver.end()) extraAttributes.insert(e, maneuver.value(e).toVariant()); diff --git a/src/location/maps/qgeorouterequest.cpp b/src/location/maps/qgeorouterequest.cpp index ab0a3109..57ef1c03 100644 --- a/src/location/maps/qgeorouterequest.cpp +++ b/src/location/maps/qgeorouterequest.cpp @@ -473,7 +473,7 @@ QGeoRouteRequest::ManeuverDetail QGeoRouteRequest::maneuverDetail() const \since 5.11 */ -void QGeoRouteRequest::setExtraParameters(const QMap<QString, QVariantMap> &extraParameters) +void QGeoRouteRequest::setExtraParameters(const QVariantMap &extraParameters) { d_ptr->extraParameters = extraParameters; } @@ -483,7 +483,7 @@ void QGeoRouteRequest::setExtraParameters(const QMap<QString, QVariantMap> &extr \since 5.11 */ -QMap<QString, QVariantMap> QGeoRouteRequest::extraParameters() const +QVariantMap QGeoRouteRequest::extraParameters() const { return d_ptr->extraParameters; } diff --git a/src/location/maps/qgeorouterequest.h b/src/location/maps/qgeorouterequest.h index 2c34479b..5a4bc61e 100644 --- a/src/location/maps/qgeorouterequest.h +++ b/src/location/maps/qgeorouterequest.h @@ -149,8 +149,8 @@ public: void setManeuverDetail(ManeuverDetail maneuverDetail); ManeuverDetail maneuverDetail() const; - void setExtraParameters(const QMap<QString, QVariantMap> &extraParameters); - QMap<QString, QVariantMap> extraParameters() const; + void setExtraParameters(const QVariantMap &extraParameters); + QVariantMap extraParameters() const; private: QExplicitlySharedDataPointer<QGeoRouteRequestPrivate> d_ptr; diff --git a/src/location/maps/qgeorouterequest_p.h b/src/location/maps/qgeorouterequest_p.h index 7b3a8499..df0cd62c 100644 --- a/src/location/maps/qgeorouterequest_p.h +++ b/src/location/maps/qgeorouterequest_p.h @@ -77,7 +77,7 @@ public: QGeoRouteRequest::RouteOptimizations routeOptimization; QGeoRouteRequest::SegmentDetail segmentDetail; QGeoRouteRequest::ManeuverDetail maneuverDetail; - QMap<QString, QVariantMap> extraParameters; + QVariantMap extraParameters; }; QT_END_NAMESPACE diff --git a/src/location/maps/qgeoroutesegment.cpp b/src/location/maps/qgeoroutesegment.cpp index 1f72bf73..5bfb4f65 100644 --- a/src/location/maps/qgeoroutesegment.cpp +++ b/src/location/maps/qgeoroutesegment.cpp @@ -370,7 +370,7 @@ QGeoRouteSegmentPrivate *QGeoRouteSegmentPrivateDefault::clone() bool QGeoRouteSegmentPrivateDefault::operator ==(const QGeoRouteSegmentPrivateDefault &other) const { - return QGeoRouteSegmentPrivateDefault::operator ==(other); + return QGeoRouteSegmentPrivate::operator ==(other); } bool QGeoRouteSegmentPrivateDefault::valid() const diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp index fef4a826..79e27ff0 100644 --- a/src/location/maps/qgeoserviceprovider.cpp +++ b/src/location/maps/qgeoserviceprovider.cpp @@ -360,7 +360,9 @@ template <> QPlaceManagerEngine *createEngine<QPlaceManagerEngine>(QGeoServicePr } template <> QNavigationManagerEngine *createEngine<QNavigationManagerEngine>(QGeoServiceProviderPrivate *d_ptr) { - return d_ptr->factory->createNavigationManagerEngine(d_ptr->cleanedParameterMap, &(d_ptr->placeError), &(d_ptr->placeErrorString)); + if (!d_ptr->factoryV2) + return nullptr; + return d_ptr->factoryV2->createNavigationManagerEngine(d_ptr->cleanedParameterMap, &(d_ptr->placeError), &(d_ptr->placeErrorString)); } /* Template for generating the code for each of the geocodingManager(), @@ -656,7 +658,7 @@ void QGeoServiceProviderPrivate::unload() delete navigationManager; navigationManager = nullptr; - factory = 0; + factory = factoryV2 = nullptr; error = QGeoServiceProvider::NoError; errorString = QLatin1String(""); metaData = QJsonObject(); @@ -686,7 +688,7 @@ void QGeoServiceProviderPrivate::filterParameterMap() void QGeoServiceProviderPrivate::loadMeta() { - factory = 0; + factory = factoryV2 = nullptr; metaData = QJsonObject(); metaData.insert(QStringLiteral("index"), -1); error = QGeoServiceProvider::NotSupportedError; @@ -727,7 +729,7 @@ void QGeoServiceProviderPrivate::loadPlugin(const QVariantMap ¶meters) if (int(metaData.value(QStringLiteral("index")).toDouble()) < 0) { error = QGeoServiceProvider::NotSupportedError; errorString = QString(QLatin1String("The geoservices provider is not supported.")); - factory = 0; + factory = factoryV2 = nullptr; return; } @@ -737,7 +739,9 @@ void QGeoServiceProviderPrivate::loadPlugin(const QVariantMap ¶meters) int idx = int(metaData.value(QStringLiteral("index")).toDouble()); // load the actual plugin - factory = qobject_cast<QGeoServiceProviderFactory *>(loader()->instance(idx)); + QObject *instance = loader()->instance(idx); + factory = qobject_cast<QGeoServiceProviderFactory *>(instance); + factoryV2 = qobject_cast<QGeoServiceProviderFactoryV2 *>(instance); } QHash<QString, QJsonObject> QGeoServiceProviderPrivate::plugins(bool reload) diff --git a/src/location/maps/qgeoserviceprovider_p.h b/src/location/maps/qgeoserviceprovider_p.h index 1aaa498c..11b86bad 100644 --- a/src/location/maps/qgeoserviceprovider_p.h +++ b/src/location/maps/qgeoserviceprovider_p.h @@ -62,6 +62,7 @@ class QGeoRoutingManager; class QGeoMappingManager; class QGeoServiceProviderFactory; +class QGeoServiceProviderFactoryV2; class QGeoServiceProviderPrivate { @@ -82,6 +83,7 @@ public: Flags features(const char *enumName); QGeoServiceProviderFactory *factory; + QGeoServiceProviderFactoryV2 *factoryV2 = nullptr; QJsonObject metaData; QVariantMap parameterMap; diff --git a/src/location/maps/qgeoserviceproviderfactory.cpp b/src/location/maps/qgeoserviceproviderfactory.cpp index c8192a32..44ed3535 100644 --- a/src/location/maps/qgeoserviceproviderfactory.cpp +++ b/src/location/maps/qgeoserviceproviderfactory.cpp @@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE \inmodule QtLocation \ingroup QtLocation-impl \since 5.6 + \deprecated \brief The QGeoServiceProviderFactory class is a factory class used as the plugin interface for services related to geographical information. @@ -52,6 +53,8 @@ QT_BEGIN_NAMESPACE The other functions should be overridden if the plugin supports the associated set of functionality. + + \sa QGeoServiceProviderFactoryV2 */ /*! @@ -161,6 +164,28 @@ QPlaceManagerEngine *QGeoServiceProviderFactory::createPlaceManagerEngine(const } /*! + \class QGeoServiceProviderFactoryV2 + \inmodule QtLocation + \ingroup QtLocation-impl + \since 5.11 + + \brief The QGeoServiceProviderFactoryV2 class is a factory class used as the + plugin interface for services related to geographical information. + + Implementers must provide a unique combination of providerName() and + providerVersion() per plugin. + + The other functions should be overridden if the plugin supports the + associated set of functionality. +*/ + +/*! +\fn QGeoServiceProviderFactoryV2::~QGeoServiceProviderFactoryV2() + +Destroys this QGeoServiceProviderFactoryV2 instance. +*/ + +/*! Returns a new QNavigationManagerEngine instance, initialized with \a parameters, which implements navigation functionality. @@ -173,7 +198,7 @@ QPlaceManagerEngine *QGeoServiceProviderFactory::createPlaceManagerEngine(const The default implementation returns nullptr, which causes a QGeoServiceProvider::NotSupportedError in QGeoServiceProvider. */ -QNavigationManagerEngine *QGeoServiceProviderFactory::createNavigationManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const +QNavigationManagerEngine *QGeoServiceProviderFactoryV2::createNavigationManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { Q_UNUSED(parameters) Q_UNUSED(error) diff --git a/src/location/maps/qgeoserviceproviderfactory.h b/src/location/maps/qgeoserviceproviderfactory.h index e1164189..1eb93a18 100644 --- a/src/location/maps/qgeoserviceproviderfactory.h +++ b/src/location/maps/qgeoserviceproviderfactory.h @@ -62,13 +62,25 @@ public: virtual QPlaceManagerEngine *createPlaceManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; +}; + +Q_DECLARE_INTERFACE(QGeoServiceProviderFactory, + "org.qt-project.qt.geoservice.serviceproviderfactory/5.0") + +class Q_LOCATION_EXPORT QGeoServiceProviderFactoryV2 : public QGeoServiceProviderFactory +{ +public: + virtual ~QGeoServiceProviderFactoryV2() {} + virtual QNavigationManagerEngine *createNavigationManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; }; -Q_DECLARE_INTERFACE(QGeoServiceProviderFactory, - "org.qt-project.qt.geoservice.serviceproviderfactory/5.0") +// Although not actually used for constructing a specialized loader, this is required for +// casting a QObject * into QGeoServiceProviderFactoryV2 * +Q_DECLARE_INTERFACE(QGeoServiceProviderFactoryV2, + "org.qt-project.qt.geoservice.serviceproviderfactoryV2/5.0") QT_END_NAMESPACE diff --git a/src/locationlabs/qlocationlabsglobal_p.h b/src/locationlabs/qlocationlabsglobal_p.h index aa965864..6dc29296 100644 --- a/src/locationlabs/qlocationlabsglobal_p.h +++ b/src/locationlabs/qlocationlabsglobal_p.h @@ -36,6 +36,17 @@ #ifndef QLOCATIONLABSGLOBAL_P_H #define QLOCATIONLABSGLOBAL_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/position/corelocation/corelocation.pro b/src/plugins/position/corelocation/corelocation.pro index 85a5aaed..6b7ba82c 100644 --- a/src/plugins/position/corelocation/corelocation.pro +++ b/src/plugins/position/corelocation/corelocation.pro @@ -15,6 +15,10 @@ OTHER_FILES += \ LIBS += -framework Foundation -framework CoreLocation +!darwin { + DISTFILES += $$OBJECTIVE_SOURCES +} + PLUGIN_TYPE = position PLUGIN_CLASS_NAME = QGeoPositionInfoSourceFactoryCL load(qt_plugin) diff --git a/src/positioning/qdoublevector2d_p.h b/src/positioning/qdoublevector2d_p.h index 69348ee1..e944d2f4 100644 --- a/src/positioning/qdoublevector2d_p.h +++ b/src/positioning/qdoublevector2d_p.h @@ -55,7 +55,7 @@ #include <QVector2D> #endif -#include "qpositioningglobal.h" +#include "qpositioningglobal_p.h" #include <QtCore/qmetatype.h> #include <QPointF> @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE class QDoubleVector3D; -class Q_POSITIONING_EXPORT QDoubleVector2D +class Q_POSITIONING_PRIVATE_EXPORT QDoubleVector2D { public: Q_DECL_CONSTEXPR inline QDoubleVector2D(); diff --git a/src/positioning/qdoublevector3d_p.h b/src/positioning/qdoublevector3d_p.h index d500fbe2..059d38f1 100644 --- a/src/positioning/qdoublevector3d_p.h +++ b/src/positioning/qdoublevector3d_p.h @@ -55,13 +55,13 @@ #include <QVector3D> #endif -#include "qpositioningglobal.h" +#include "qpositioningglobal_p.h" #include "qdoublevector2d_p.h" #include <QtCore/qmetatype.h> QT_BEGIN_NAMESPACE -class Q_POSITIONING_EXPORT QDoubleVector3D +class Q_POSITIONING_PRIVATE_EXPORT QDoubleVector3D { public: Q_DECL_CONSTEXPR inline QDoubleVector3D(); diff --git a/src/positioning/qgeopositioninfo_p.h b/src/positioning/qgeopositioninfo_p.h index cc4a9f3d..4d6ccb8c 100644 --- a/src/positioning/qgeopositioninfo_p.h +++ b/src/positioning/qgeopositioninfo_p.h @@ -39,6 +39,17 @@ #ifndef QGEOPOSITIONINFO_P_H #define QGEOPOSITIONINFO_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtPositioning/private/qpositioningglobal_p.h> #include "qgeopositioninfo.h" #include <QHash> |