summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-03-20 12:54:12 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-03-20 12:54:23 +0100
commit84453c169555c7b6d4c22d455c832150c653d3b0 (patch)
tree0f10ef42ef9119c98dab495412b173c1d0c5a8e9
parenta69c93dd84d6811818241b4ff7444a2383661b82 (diff)
parent1ced79ad7cc256eb82113e3419cb09926ceae9c3 (diff)
downloadqtlocation-84453c169555c7b6d4c22d455c832150c653d3b0.tar.gz
Merge remote-tracking branch 'origin/5.11' into wip/navigation
Change-Id: I558b3b2de394b946d70f484a19d0c1f7bef25515
-rw-r--r--src/imports/positioning/qquickgeocoordinateanimation.cpp6
-rw-r--r--src/location/declarativemaps/qdeclarativecirclemapitem.cpp10
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroute.cpp15
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroute_p.h4
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel.cpp51
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel_p.h6
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp10
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem.cpp9
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem.cpp10
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp3
-rw-r--r--src/location/maps/qgeorouteparserosrmv5.cpp7
-rw-r--r--src/location/maps/qgeorouterequest.cpp4
-rw-r--r--src/location/maps/qgeorouterequest.h4
-rw-r--r--src/location/maps/qgeorouterequest_p.h2
-rw-r--r--src/location/maps/qgeoroutesegment.cpp2
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp14
-rw-r--r--src/location/maps/qgeoserviceprovider_p.h2
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.cpp27
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.h16
-rw-r--r--src/locationlabs/qlocationlabsglobal_p.h11
-rw-r--r--src/plugins/position/corelocation/corelocation.pro4
-rw-r--r--src/positioning/qdoublevector2d_p.h4
-rw-r--r--src/positioning/qdoublevector3d_p.h4
-rw-r--r--src/positioning/qgeopositioninfo_p.h11
-rw-r--r--tests/auto/declarative_ui/tst_map_mouse.qml51
-rw-r--r--tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h2
-rw-r--r--tests/auto/qgeorouterequest/tst_qgeorouterequest.cpp14
27 files changed, 242 insertions, 61 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 &parameters)
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 &parameters)
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 &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
+QNavigationManagerEngine *QGeoServiceProviderFactoryV2::createNavigationManagerEngine(const QVariantMap &parameters, 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 &parameters,
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 &parameters,
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>
diff --git a/tests/auto/declarative_ui/tst_map_mouse.qml b/tests/auto/declarative_ui/tst_map_mouse.qml
index dd9de73a..e5294f67 100644
--- a/tests/auto/declarative_ui/tst_map_mouse.qml
+++ b/tests/auto/declarative_ui/tst_map_mouse.qml
@@ -107,13 +107,12 @@ Item {
preventStealing: true
- // The following signal handlers use arguments[0] instead of mouse due to QTBUG-36560
- onClicked: page.setMouseData(mouseUpper, arguments[0])
- onDoubleClicked: page.setMouseData(mouseUpper, arguments[0])
- onPressed: page.setMouseData(mouseUpper, arguments[0])
- onReleased: page.setMouseData(mouseUpper, arguments[0])
- onPositionChanged: page.setMouseData(mouseUpper, arguments[0])
- onPressAndHold: page.setMouseData(mouseUpper, arguments[0])
+ onClicked: page.setMouseData(mouseUpper, mouse)
+ onDoubleClicked: page.setMouseData(mouseUpper, mouse)
+ onPressed: page.setMouseData(mouseUpper, mouse)
+ onReleased: page.setMouseData(mouseUpper, mouse)
+ onPositionChanged: page.setMouseData(mouseUpper, mouse)
+ onPressAndHold: page.setMouseData(mouseUpper, mouse)
}
MouseArea {
id: mouseLower
@@ -128,13 +127,12 @@ Item {
property bool lastIsClick: false
property bool lastAccepted: false;
- // The following signal handlers use arguments[0] instead of mouse due to QTBUG-36560
- onClicked: page.setMouseData(mouseLower, arguments[0])
- onDoubleClicked: page.setMouseData(mouseLower, arguments[0])
- onPressed: page.setMouseData(mouseLower, arguments[0])
- onReleased: page.setMouseData(mouseLower, arguments[0])
- onPositionChanged: page.setMouseData(mouseLower, arguments[0])
- onPressAndHold: page.setMouseData(mouseLower, arguments[0])
+ onClicked: page.setMouseData(mouseLower, mouse)
+ onDoubleClicked: page.setMouseData(mouseLower, mouse)
+ onPressed: page.setMouseData(mouseLower, mouse)
+ onReleased: page.setMouseData(mouseLower, mouse)
+ onPositionChanged: page.setMouseData(mouseLower, mouse)
+ onPressAndHold: page.setMouseData(mouseLower, mouse)
}
MouseArea {
id: mouseOverlapper
@@ -149,13 +147,12 @@ Item {
property bool lastIsClick: false
property bool lastAccepted: false;
- // The following signal handlers use arguments[0] instead of mouse due to QTBUG-36560
- onClicked: page.setMouseData(mouseOverlapper, arguments[0])
- onDoubleClicked: page.setMouseData(mouseOverlapper, arguments[0])
- onPressed: page.setMouseData(mouseOverlapper, arguments[0])
- onReleased: page.setMouseData(mouseOverlapper, arguments[0])
- onPositionChanged: page.setMouseData(mouseOverlapper, arguments[0])
- onPressAndHold: page.setMouseData(mouseOverlapper, arguments[0])
+ onClicked: page.setMouseData(mouseOverlapper, mouse)
+ onDoubleClicked: page.setMouseData(mouseOverlapper, mouse)
+ onPressed: page.setMouseData(mouseOverlapper, mouse)
+ onReleased: page.setMouseData(mouseOverlapper, mouse)
+ onPositionChanged: page.setMouseData(mouseOverlapper, mouse)
+ onPressAndHold: page.setMouseData(mouseOverlapper, mouse)
}
}
@@ -523,7 +520,7 @@ Item {
compare(mouseLowerPressedSpy.count, 1)
compare(mouseLowerReleasedSpy.count, 1)
-
+ skip("Makes other tests fail due to QTBUG-66534")
compare(mouseOverlapperPressedSpy.count, 0)
mousePress(map, 55, 75)
compare(mouseUpperPressedSpy.count, 2)
@@ -672,6 +669,16 @@ Item {
compare(mouseOverlapperDoubleClickedSpy.count, 4)
}
+ function test_release_does_not_block_clicked() { // QTBUG-66534
+ clear_data()
+ mousePress(map, 55, 75)
+ compare(mouseOverlapperPressedSpy.count, 1)
+ mouseRelease(map, 55, 25)
+ compare(mouseOverlapperReleasedSpy.count, 1)
+ mouseClick(map, 25, 25)
+ compare(mouseUpperClickedSpy.count, 1)
+ }
+
function test_zzz_basic_press_and_hold() { // _zzz_ to ensure execution last (takes time)
clear_data();
wait(1000);
diff --git a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h
index 0a0ec463..303015b7 100644
--- a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h
+++ b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h
@@ -169,7 +169,7 @@ public:
QList<QGeoRoute> routes;
int travelTime = 0;
if (request.extraParameters().contains("test-traveltime"))
- travelTime = request.extraParameters().value("test-traveltime").value("requestedTime").toInt();
+ travelTime = request.extraParameters().value("test-traveltime").toMap().value("requestedTime").toInt();
for (int i = 0; i < request.numberAlternativeRoutes(); ++i) {
QGeoRoute route;
diff --git a/tests/auto/qgeorouterequest/tst_qgeorouterequest.cpp b/tests/auto/qgeorouterequest/tst_qgeorouterequest.cpp
index 508571c3..d29e3d49 100644
--- a/tests/auto/qgeorouterequest/tst_qgeorouterequest.cpp
+++ b/tests/auto/qgeorouterequest/tst_qgeorouterequest.cpp
@@ -321,25 +321,27 @@ void tst_QGeoRouteRequest::featureWeight()
void tst_QGeoRouteRequest::extraParameters_data()
{
- QTest::addColumn<QMap<QString, QVariantMap>>("extraParameters");
+ QTest::addColumn<QVariantMap>("extraParameters");
- QMap<QString, QVariantMap> params;
+ QVariantMap params;
QTest::newRow("Empty") << params;
- params["param1"] = {{"property1", QVariant(42)} , {"property2", QVariant("42")} , {"property3", QVariant("42.0")}};
+ const QVariantMap param1 = {{"property1", QVariant(42)} , {"property2", QVariant("42")} , {"property3", QVariant("42.0")}};
+ params["param1"] = param1;
QTest::newRow("One param") << params;
- params["param2"] = {{"property1", QVariant(43)} , {"property2", QVariant("43")} , {"property3", QVariant("43.0")}};
+ const QVariantMap param2 = {{"property1", QVariant(43)} , {"property2", QVariant("43")} , {"property3", QVariant("43.0")}};
+ params["param2"] = param2;
QTest::newRow("Two params") << params;
}
void tst_QGeoRouteRequest::extraParameters()
{
- typedef QMap<QString, QVariantMap> ParameterType;
+ typedef QVariantMap ParameterType;
QFETCH(ParameterType , extraParameters);
- QMap<QString, QVariantMap> emptyParams;
+ QVariantMap emptyParams;
qgeorouterequest->setExtraParameters(extraParameters);
QCOMPARE(qgeorouterequest->extraParameters(), extraParameters);
qgeorouterequest->setExtraParameters(emptyParams);