diff options
36 files changed, 393 insertions, 90 deletions
diff --git a/.qmake.conf b/.qmake.conf index 4afd972d..8106c563 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,4 +1,4 @@ load(qt_build_config) CONFIG += warning_clean -MODULE_VERSION = 5.10.0 +MODULE_VERSION = 5.11.0 diff --git a/configure.json b/configure.json index d54624af..379d8b4a 100644 --- a/configure.json +++ b/configure.json @@ -1,5 +1,6 @@ { "subconfigs": [ - "src/positioning" + "src/positioning", + "src/location" ] } diff --git a/dist/changes-5.6.3 b/dist/changes-5.6.3 new file mode 100644 index 00000000..4709ff2b --- /dev/null +++ b/dist/changes-5.6.3 @@ -0,0 +1,38 @@ +Qt 5.6.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.6.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.6 series is binary compatible with the 5.5.x series. +Applications compiled for 5.5 will continue to run with 5.6. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Library * +**************************************************************************** + +QtLocation +---------- + + - [QTBUG-56099] Updated HERE plugin base address + - [QTBUG-56119] Added OSRMv5 support to the osm plugin + - [QTBUG-57027] Fixed fitViewportToGeoShape on rectangles crossing the date + line. + - Updated HERE plugin geocoding endpoints + + +QtPositioning +------------- + + - [QTBUG-54844] Fixed error status for QGeoPositionInfoSourceAndroid + - [QTBUG-56623] WinRT backend now uses backend-provided timestamps diff --git a/examples/location/places_map/doc/images/places_map.png b/examples/location/places_map/doc/images/places_map.png Binary files differindex 72317e2d..4982df23 100644 --- a/examples/location/places_map/doc/images/places_map.png +++ b/examples/location/places_map/doc/images/places_map.png diff --git a/examples/location/places_map/main.cpp b/examples/location/places_map/main.cpp index a2cd8fc0..aeb7eaf3 100644 --- a/examples/location/places_map/main.cpp +++ b/examples/location/places_map/main.cpp @@ -46,6 +46,8 @@ int main(int argc, char **argv) QGuiApplication app(argc,argv); QQuickView view; view.setSource(QUrl(QStringLiteral("qrc:///places_map.qml"))); + view.setWidth(360); + view.setHeight(640); view.show(); return app.exec(); } diff --git a/examples/location/places_map/places_map.qml b/examples/location/places_map/places_map.qml index 467a31de..cd487fa9 100644 --- a/examples/location/places_map/places_map.qml +++ b/examples/location/places_map/places_map.qml @@ -45,8 +45,7 @@ import QtLocation 5.6 //! [Imports] Rectangle { - width: 360 - height: 640 + anchors.fill: parent //! [Initialize Plugin] Plugin { diff --git a/src/3rdparty/mapbox-gl-native b/src/3rdparty/mapbox-gl-native -Subproject c53896caefc96a8c18ab746026330ddc4fc0338 +Subproject 1c633072fcea7ad153ab6f8ec40dd72d83541ea diff --git a/src/imports/positioning/qdeclarativepositionsource.cpp b/src/imports/positioning/qdeclarativepositionsource.cpp index b0e990da..05232d51 100644 --- a/src/imports/positioning/qdeclarativepositionsource.cpp +++ b/src/imports/positioning/qdeclarativepositionsource.cpp @@ -559,10 +559,9 @@ QDeclarativePositionSource::PositioningMethods QDeclarativePositionSource::prefe void QDeclarativePositionSource::start() { - if (!m_positionSource) - return; + if (m_positionSource) + m_positionSource->startUpdates(); - m_positionSource->startUpdates(); if (!m_active) { m_active = true; emit activeChanged(); @@ -721,6 +720,12 @@ void QDeclarativePositionSource::componentComplete() static_cast<QGeoPositionInfoSource::PositioningMethods>(int(m_preferredPositioningMethods))); setPosition(m_positionSource->lastKnownPosition()); + + if (m_active) + QTimer::singleShot(0, this, SLOT(start())); // delay ensures all properties have been set + } else if (m_active) { + m_active = false; + emit activeChanged(); } if (previousUpdateInterval != updateInterval()) @@ -733,12 +738,6 @@ void QDeclarativePositionSource::componentComplete() emit supportedPositioningMethodsChanged(); emit validityChanged(); - - if (m_active) { - m_active = false; - emit activeChanged(); - } - emit nameChanged(); } } diff --git a/src/location/configure.json b/src/location/configure.json new file mode 100644 index 00000000..4de6e865 --- /dev/null +++ b/src/location/configure.json @@ -0,0 +1,70 @@ +{ + "module": "location", + "depends": [ + "gui" + ], + + "features": { + "geoservices_osm": { + "label": "OpenStreetMap", + "purpose": "Provides access to OpenStreetMap geoservices", + "section": "Location", + "condition": "features.concurrent", + "output": [ "privateFeature" ] + }, + "geoservices_here": { + "label": "HERE", + "purpose": "Provides access to HERE geoservices", + "section": "Location", + "output": [ "privateFeature" ] + }, + "geoservices_esri": { + "label": "Esri", + "purpose": "Provides access to Esri geoservices", + "section": "Location", + "output": [ "privateFeature" ] + }, + "geoservices_mapbox": { + "label": "Mapbox", + "purpose": "Provides access to Mapbox geoservices", + "section": "Location", + "output": [ "privateFeature" ] + }, + "geoservices_mapboxgl": { + "label": "MapboxGL", + "purpose": "Provides access to the Mapbox vector maps", + "section": "Location", + "condition": [ + "features.opengl", + "features.c++14", + "!config.qnx && (!config.win32 || config.mingw)" + ], + "output": [ "privateFeature" ] + }, + "geoservices_itemsoverlay": { + "label": "Itemsoverlay", + "purpose": "Provides access to the itemsoverlay maps", + "section": "Location", + "output": [ "privateFeature" ] + } + }, + + "summary": [ + { + "section": "Qt Location", + "entries": [ + { + "section": "Geoservice plugins", + "entries": [ + "geoservices_osm", + "geoservices_here", + "geoservices_esri", + "geoservices_mapbox", + "geoservices_mapboxgl", + "geoservices_itemsoverlay" + ] + } + ] + } + ] +} diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp index 5f002bf9..91328dc7 100644 --- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp @@ -262,7 +262,7 @@ void QGeoMapCircleGeometry::updateScreenPointsInvert(const QList<QDoubleVector2D sourceBounds_ = screenBounds_; } -static bool crossEarthPole(const QGeoCoordinate ¢er, qreal distance) +bool QDeclarativeCircleMapItem::crossEarthPole(const QGeoCoordinate ¢er, qreal distance) { qreal poleLat = 90; QGeoCoordinate northPole = QGeoCoordinate(poleLat, center.longitude()); @@ -275,7 +275,7 @@ static bool crossEarthPole(const QGeoCoordinate ¢er, qreal distance) return false; } -static void calculatePeripheralPoints(QList<QGeoCoordinate> &path, +void QDeclarativeCircleMapItem::calculatePeripheralPoints(QList<QGeoCoordinate> &path, const QGeoCoordinate ¢er, qreal distance, int steps, @@ -644,9 +644,9 @@ void QDeclarativeCircleMapItem::updateCirclePathForRendering(QList<QDoubleVector const QGeoCoordinate ¢er, qreal distance) { - qreal poleLat = 90; - qreal distanceToNorthPole = center.distanceTo(QGeoCoordinate(poleLat, 0)); - qreal distanceToSouthPole = center.distanceTo(QGeoCoordinate(-poleLat, 0)); + const qreal poleLat = 90; + const qreal distanceToNorthPole = center.distanceTo(QGeoCoordinate(poleLat, 0)); + const qreal distanceToSouthPole = center.distanceTo(QGeoCoordinate(-poleLat, 0)); bool crossNorthPole = distanceToNorthPole < distance; bool crossSouthPole = distanceToSouthPole < distance; diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem_p.h b/src/location/declarativemaps/qdeclarativecirclemapitem_p.h index 15774427..c117b444 100644 --- a/src/location/declarativemaps/qdeclarativecirclemapitem_p.h +++ b/src/location/declarativemaps/qdeclarativecirclemapitem_p.h @@ -96,6 +96,12 @@ public: const QGeoShape &geoShape() const Q_DECL_OVERRIDE; QGeoMap::ItemType itemType() const Q_DECL_OVERRIDE; + static bool crossEarthPole(const QGeoCoordinate ¢er, qreal distance); + static void calculatePeripheralPoints(QList<QGeoCoordinate> &path, const QGeoCoordinate ¢er, + qreal distance, int steps, QGeoCoordinate &leftBound); + bool preserveCircleGeometry(QList<QDoubleVector2D> &path, const QGeoCoordinate ¢er, + qreal distance); + Q_SIGNALS: void centerChanged(const QGeoCoordinate ¢er); void radiusChanged(qreal radius); @@ -111,8 +117,6 @@ protected Q_SLOTS: private: void updateCirclePath(); - bool preserveCircleGeometry(QList<QDoubleVector2D> &path, const QGeoCoordinate ¢er, - qreal distance); void updateCirclePathForRendering(QList<QDoubleVector2D> &path, const QGeoCoordinate ¢er, qreal distance); diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp index ee435a5a..3e2a1aea 100644 --- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp @@ -319,6 +319,9 @@ void QDeclarativeGeocodeModel::pluginReady() this, SLOT(geocodeFinished(QGeoCodeReply*))); connect(geocodingManager, SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString)), this, SLOT(geocodeError(QGeoCodeReply*,QGeoCodeReply::Error,QString))); + + if (complete_ && autoUpdate_) + update(); } /*! diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 37cfc303..9b19a0ac 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -553,26 +553,26 @@ QQuickGeoMapGestureArea *QDeclarativeGeoMap::gesture() */ void QDeclarativeGeoMap::populateMap() { - QObjectList kids = children(); - QList<QQuickItem *> quickKids = childItems(); - for (int i=0; i < quickKids.count(); ++i) - kids.append(quickKids.at(i)); + QSet<QObject *> kids = children().toSet(); + const QList<QQuickItem *> quickKids = childItems(); + for (QQuickItem *ite: quickKids) + kids.insert(ite); - for (int i = 0; i < kids.size(); ++i) { + for (QObject *k : qAsConst(kids)) { // dispatch items appropriately - QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(kids.at(i)); + QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(k); if (mapView) { m_mapViews.append(mapView); setupMapView(mapView); continue; } - QDeclarativeGeoMapItemBase *mapItem = qobject_cast<QDeclarativeGeoMapItemBase *>(kids.at(i)); + QDeclarativeGeoMapItemBase *mapItem = qobject_cast<QDeclarativeGeoMapItemBase *>(k); if (mapItem) { addMapItem(mapItem); continue; } // Allow to add to the map Map items contained inside a parent QQuickItem, but only those at one level of nesting. - QDeclarativeGeoMapItemGroup *itemGroup = qobject_cast<QDeclarativeGeoMapItemGroup *>(kids.at(i)); + QDeclarativeGeoMapItemGroup *itemGroup = qobject_cast<QDeclarativeGeoMapItemGroup *>(k); if (itemGroup) { addMapItemGroup(itemGroup); continue; diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp index 4b8b2d7c..9e4fee8a 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider.cpp @@ -113,12 +113,42 @@ void QDeclarativeGeoServiceProvider::setName(const QString &name) return; name_ = name; + + if (complete_) + tryAttach(); + + emit nameChanged(name_); +} + +/*! + \internal +*/ +bool QDeclarativeGeoServiceProvider::parametersReady() { + for (const QDeclarativeGeoServiceProviderParameter *p: qAsConst(parameters_)) { + if (!p->isInitialized()) + return false; + } + return true; +} + +/*! + \internal +*/ +void QDeclarativeGeoServiceProvider::tryAttach() +{ + if (!parametersReady()) + return; + delete sharedProvider_; + sharedProvider_ = nullptr; + + if (name_.isEmpty()) + return; + sharedProvider_ = new QGeoServiceProvider(name_, parameterMap()); sharedProvider_->setLocale(locales_.at(0)); sharedProvider_->setAllowExperimental(experimental_); - emit nameChanged(name_); emit attached(); } @@ -147,11 +177,17 @@ QStringList QDeclarativeGeoServiceProvider::availableServiceProviders() void QDeclarativeGeoServiceProvider::componentComplete() { complete_ = true; - if (!name_.isEmpty()) { - return; + + for (QDeclarativeGeoServiceProviderParameter *p: qAsConst(parameters_)) { + if (!p->isInitialized()) { + connect(p, &QDeclarativeGeoServiceProviderParameter::initialized, + this, &QDeclarativeGeoServiceProvider::tryAttach); + } } - if (!prefer_.isEmpty() + if (!name_.isEmpty()) { + tryAttach(); + } else if (!prefer_.isEmpty() || required_->mappingRequirements() != NoMappingFeatures || required_->routingRequirements() != NoRoutingFeatures || required_->geocodingRequirements() != NoGeocodingFeatures @@ -796,15 +832,18 @@ QDeclarativeGeoServiceProviderParameter::~QDeclarativeGeoServiceProviderParamete \qmlproperty string PluginParameter::name This property holds the name of the plugin parameter as a single formatted string. + This property is a write-once property. */ void QDeclarativeGeoServiceProviderParameter::setName(const QString &name) { - if (name_ == name) + if (!name_.isEmpty() || name.isEmpty()) return; name_ = name; emit nameChanged(name_); + if (value_.isValid()) + emit initialized(); } QString QDeclarativeGeoServiceProviderParameter::name() const @@ -816,15 +855,18 @@ QString QDeclarativeGeoServiceProviderParameter::name() const \qmlproperty QVariant PluginParameter::value This property holds the value of the plugin parameter which support different types of values (variant). + This property is a write-once property. */ void QDeclarativeGeoServiceProviderParameter::setValue(const QVariant &value) { - if (value_ == value) + if (value_.isValid() || !value.isValid() || value.isNull()) return; value_ = value; emit valueChanged(value_); + if (!name_.isEmpty()) + emit initialized(); } QVariant QDeclarativeGeoServiceProviderParameter::value() const @@ -832,6 +874,11 @@ QVariant QDeclarativeGeoServiceProviderParameter::value() const return value_; } +bool QDeclarativeGeoServiceProviderParameter::isInitialized() const +{ + return !name_.isEmpty() && value_.isValid(); +} + /******************************************************************************* *******************************************************************************/ diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h index 426c6b4d..c1ad4987 100644 --- a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h +++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h @@ -78,9 +78,12 @@ public: void setValue(const QVariant &value); QVariant value() const; + bool isInitialized() const; + Q_SIGNALS: void nameChanged(const QString &name); void valueChanged(const QVariant &value); + void initialized(); private: QString name_; @@ -210,6 +213,8 @@ Q_SIGNALS: void allowExperimentalChanged(bool allow); private: + bool parametersReady(); + void tryAttach(); static void parameter_append(QQmlListProperty<QDeclarativeGeoServiceProviderParameter> *prop, QDeclarativeGeoServiceProviderParameter *mapObject); static int parameter_count(QQmlListProperty<QDeclarativeGeoServiceProviderParameter> *prop); static QDeclarativeGeoServiceProviderParameter *parameter_at(QQmlListProperty<QDeclarativeGeoServiceProviderParameter> *prop, int index); diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp index 99b65766..b1878f00 100644 --- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp +++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp @@ -974,14 +974,20 @@ void QQuickGeoMapGestureArea::handleWheelEvent(QWheelEvent *event) // Not using AltModifier as, for some reason, it causes angleDelta to be 0 if (event->modifiers() & Qt::ShiftModifier && rotationEnabled()) { + emit rotationStarted(&m_pinch.m_event); // First set bearing const double bearingDelta = event->angleDelta().y() * qreal(0.05); m_declarativeMap->setBearing(m_declarativeMap->bearing() + bearingDelta); // then reanchor m_declarativeMap->setCenter(m_map->geoProjection().anchorCoordinateToPoint(wheelGeoPos, preZoomPoint)); + emit rotationUpdated(&m_pinch.m_event); + emit rotationFinished(&m_pinch.m_event); } else if (event->modifiers() & Qt::ControlModifier && tiltEnabled()) { + emit tiltStarted(&m_pinch.m_event); const double tiltDelta = event->angleDelta().y() * qreal(0.05); m_declarativeMap->setTilt(m_declarativeMap->tilt() + tiltDelta); + emit tiltUpdated(&m_pinch.m_event); + emit tiltFinished(&m_pinch.m_event); } else if (pinchEnabled()) { const double zoomLevelDelta = event->angleDelta().y() * qreal(0.001); // Gesture area should always honor maxZL, but Map might not. diff --git a/src/location/doc/qtlocation.qdocconf b/src/location/doc/qtlocation.qdocconf index 695860a0..58eeaef7 100644 --- a/src/location/doc/qtlocation.qdocconf +++ b/src/location/doc/qtlocation.qdocconf @@ -16,7 +16,7 @@ qhp.QtLocation.indexRoot = qhp.QtLocation.filterAttributes = qtlocation $QT_VERSION qtrefdoc qhp.QtLocation.customFilters.Qt.name = QtLocation $QT_VERSION -qhp.QtLocation.customFilters.Qt.filterAttributes = qtLocation $QT_VERSION +qhp.QtLocation.customFilters.Qt.filterAttributes = qtlocation $QT_VERSION qhp.QtLocation.subprojects = classes qml examples qhp.QtLocation.subprojects.classes.title = C++ Classes qhp.QtLocation.subprojects.classes.indexTitle = Qt Location C++ Classes diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro index 07c34798..b81ad34a 100644 --- a/src/plugins/geoservices/geoservices.pro +++ b/src/plugins/geoservices/geoservices.pro @@ -1,12 +1,14 @@ TEMPLATE = subdirs -SUBDIRS = nokia mapbox esri itemsoverlay +QT_FOR_CONFIG += location-private # pulls in the features defined in configure.json -qtConfig(concurrent) { - SUBDIRS += osm -} +qtConfig(geoservices_here): SUBDIRS += nokia +qtConfig(geoservices_mapbox): SUBDIRS += mapbox +qtConfig(geoservices_esri): SUBDIRS += esri +qtConfig(geoservices_itemsoverlay): SUBDIRS += itemsoverlay +qtConfig(geoservices_osm): SUBDIRS += osm -qtConfig(opengl):qtConfig(c++14):!win32|mingw:!qnx { +qtConfig(geoservices_mapboxgl) { !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) { warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") } else { diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp index c82b98f3..8df00905 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp @@ -160,6 +160,11 @@ void QGeoMapMapboxGLPrivate::addParameter(QGeoMapParameter *param) QObject::connect(param, &QGeoMapParameter::propertyUpdated, q, &QGeoMapMapboxGL::onParameterPropertyUpdated); + + if (m_styleLoaded) { + m_styleChanges << QMapboxGLStyleChange::addMapParameter(param); + emit q->sgNodeChanged(); + } } void QGeoMapMapboxGLPrivate::removeParameter(QGeoMapParameter *param) @@ -171,8 +176,7 @@ void QGeoMapMapboxGLPrivate::removeParameter(QGeoMapParameter *param) QGeoMap::ItemTypes QGeoMapMapboxGLPrivate::supportedMapItemTypes() const { - // TODO https://bugreports.qt.io/browse/QTBUG-58869 - return QGeoMap::MapRectangle | QGeoMap::MapPolygon | QGeoMap::MapPolyline; + return QGeoMap::MapRectangle | QGeoMap::MapCircle | QGeoMap::MapPolygon | QGeoMap::MapPolyline; } void QGeoMapMapboxGLPrivate::addMapItem(QDeclarativeGeoMapItemBase *item) @@ -183,25 +187,40 @@ void QGeoMapMapboxGLPrivate::addMapItem(QDeclarativeGeoMapItemBase *item) case QGeoMap::NoItem: case QGeoMap::MapQuickItem: case QGeoMap::CustomMapItem: - case QGeoMap::MapCircle: return; case QGeoMap::MapRectangle: { - QDeclarativeRectangleMapItem *mapItem = qobject_cast<QDeclarativeRectangleMapItem *>(item); + QDeclarativeRectangleMapItem *mapItem = static_cast<QDeclarativeRectangleMapItem *>(item); + QObject::connect(mapItem, &QQuickItem::visibleChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); + QObject::connect(mapItem, &QDeclarativeGeoMapItemBase::mapItemOpacityChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); QObject::connect(mapItem, &QDeclarativeRectangleMapItem::bottomRightChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); QObject::connect(mapItem, &QDeclarativeRectangleMapItem::topLeftChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); QObject::connect(mapItem, &QDeclarativeRectangleMapItem::colorChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); QObject::connect(mapItem->border(), &QDeclarativeMapLineProperties::colorChanged, q, &QGeoMapMapboxGL::onMapItemSubPropertyChanged); QObject::connect(mapItem->border(), &QDeclarativeMapLineProperties::widthChanged, q, &QGeoMapMapboxGL::onMapItemUnsupportedPropertyChanged); } break; + case QGeoMap::MapCircle: { + QDeclarativeCircleMapItem *mapItem = static_cast<QDeclarativeCircleMapItem *>(item); + QObject::connect(mapItem, &QQuickItem::visibleChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); + QObject::connect(mapItem, &QDeclarativeGeoMapItemBase::mapItemOpacityChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); + QObject::connect(mapItem, &QDeclarativeCircleMapItem::centerChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); + QObject::connect(mapItem, &QDeclarativeCircleMapItem::radiusChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); + QObject::connect(mapItem, &QDeclarativeCircleMapItem::colorChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); + QObject::connect(mapItem->border(), &QDeclarativeMapLineProperties::colorChanged, q, &QGeoMapMapboxGL::onMapItemSubPropertyChanged); + QObject::connect(mapItem->border(), &QDeclarativeMapLineProperties::widthChanged, q, &QGeoMapMapboxGL::onMapItemUnsupportedPropertyChanged); + } break; case QGeoMap::MapPolygon: { - QDeclarativePolygonMapItem *mapItem = qobject_cast<QDeclarativePolygonMapItem *>(item); + QDeclarativePolygonMapItem *mapItem = static_cast<QDeclarativePolygonMapItem *>(item); + QObject::connect(mapItem, &QQuickItem::visibleChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); + QObject::connect(mapItem, &QDeclarativeGeoMapItemBase::mapItemOpacityChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); QObject::connect(mapItem, &QDeclarativePolygonMapItem::pathChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); QObject::connect(mapItem, &QDeclarativePolygonMapItem::colorChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); QObject::connect(mapItem->border(), &QDeclarativeMapLineProperties::colorChanged, q, &QGeoMapMapboxGL::onMapItemSubPropertyChanged); QObject::connect(mapItem->border(), &QDeclarativeMapLineProperties::widthChanged, q, &QGeoMapMapboxGL::onMapItemUnsupportedPropertyChanged); } break; case QGeoMap::MapPolyline: { - QDeclarativePolylineMapItem *mapItem = qobject_cast<QDeclarativePolylineMapItem *>(item); + QDeclarativePolylineMapItem *mapItem = static_cast<QDeclarativePolylineMapItem *>(item); + QObject::connect(mapItem, &QQuickItem::visibleChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); + QObject::connect(mapItem, &QDeclarativeGeoMapItemBase::mapItemOpacityChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); QObject::connect(mapItem, &QDeclarativePolylineMapItem::pathChanged, q, &QGeoMapMapboxGL::onMapItemGeometryChanged); QObject::connect(mapItem->line(), &QDeclarativeMapLineProperties::colorChanged, q, &QGeoMapMapboxGL::onMapItemSubPropertyChanged); QObject::connect(mapItem->line(), &QDeclarativeMapLineProperties::widthChanged, q, &QGeoMapMapboxGL::onMapItemSubPropertyChanged); @@ -223,11 +242,13 @@ void QGeoMapMapboxGLPrivate::removeMapItem(QDeclarativeGeoMapItemBase *item) case QGeoMap::NoItem: case QGeoMap::MapQuickItem: case QGeoMap::CustomMapItem: - case QGeoMap::MapCircle: return; case QGeoMap::MapRectangle: q->disconnect(static_cast<QDeclarativeRectangleMapItem *>(item)->border()); break; + case QGeoMap::MapCircle: + q->disconnect(static_cast<QDeclarativeCircleMapItem *>(item)->border()); + break; case QGeoMap::MapPolygon: q->disconnect(static_cast<QDeclarativePolygonMapItem *>(item)->border()); break; @@ -378,6 +399,7 @@ void QGeoMapMapboxGL::onMapItemPropertyChanged() QDeclarativeGeoMapItemBase *item = static_cast<QDeclarativeGeoMapItemBase *>(sender()); d->m_styleChanges << QMapboxGLStyleSetPaintProperty::fromMapItem(item); + d->m_styleChanges << QMapboxGLStyleSetLayoutProperty::fromMapItem(item); emit sgNodeChanged(); } diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp index 9fa8f695..cc48afb2 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp @@ -85,10 +85,14 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian tr("Light"), false, false, ++mapId, pluginName, cameraCaps); mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/dark-v9"), tr("Dark"), false, false, ++mapId, pluginName, cameraCaps); - mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/traffic-day-v1"), - tr("Streets Traffic Day"), false, false, ++mapId, pluginName, cameraCaps); - mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/traffic-night-v1"), - tr("Streets Traffic Night"), false, true, ++mapId, pluginName, cameraCaps); + mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/navigation-preview-day-v2"), + tr("Navigation Preview Day"), false, false, ++mapId, pluginName, cameraCaps); + mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/navigation-preview-night-v2"), + tr("Navigation Preview Night"), false, true, ++mapId, pluginName, cameraCaps); + mapTypes << QGeoMapType(QGeoMapType::CarNavigationMap, QStringLiteral("mapbox://styles/mapbox/navigation-guidance-day-v2"), + tr("Navigation Guidance Day"), false, false, ++mapId, pluginName, cameraCaps); + mapTypes << QGeoMapType(QGeoMapType::CarNavigationMap, QStringLiteral("mapbox://styles/mapbox/navigation-guidance-night-v2"), + tr("Navigation Guidance Night"), false, true, ++mapId, pluginName, cameraCaps); if (parameters.contains(QStringLiteral("mapboxgl.mapping.additional_style_urls"))) { const QString ids = parameters.value(QStringLiteral("mapboxgl.mapping.additional_style_urls")).toString(); diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp index f79f0a38..69bb6e4b 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp @@ -86,6 +86,32 @@ QMapbox::Feature featureFromMapRectangle(QDeclarativeRectangleMapItem *mapItem) return QMapbox::Feature(QMapbox::Feature::PolygonType, geometry, {}, getId(mapItem)); } +QMapbox::Feature featureFromMapCircle(QDeclarativeCircleMapItem *mapItem) +{ + static const int circleSamples = 128; + + QList<QGeoCoordinate> path; + QGeoCoordinate leftBound; + QDeclarativeCircleMapItem::calculatePeripheralPoints(path, mapItem->center(), mapItem->radius(), circleSamples, leftBound); + QList<QDoubleVector2D> pathProjected; + for (const QGeoCoordinate &c : qAsConst(path)) + pathProjected << mapItem->map()->geoProjection().geoToMapProjection(c); + if (QDeclarativeCircleMapItem::crossEarthPole(mapItem->center(), mapItem->radius())) + mapItem->preserveCircleGeometry(pathProjected, mapItem->center(), mapItem->radius()); + path.clear(); + for (const QDoubleVector2D &c : qAsConst(pathProjected)) + path << mapItem->map()->geoProjection().mapProjectionToGeo(c); + + + QMapbox::Coordinates coordinates; + for (const QGeoCoordinate &coordinate : path) { + coordinates << QMapbox::Coordinate { coordinate.latitude(), coordinate.longitude() }; + } + coordinates.append(coordinates.first()); // closing the path + QMapbox::CoordinatesCollections geometry { { coordinates } }; + return QMapbox::Feature(QMapbox::Feature::PolygonType, geometry, {}, getId(mapItem)); +} + QMapbox::Feature featureFromMapPolygon(QDeclarativePolygonMapItem *mapItem) { const QGeoPath *path = static_cast<const QGeoPath *>(&mapItem->geoShape()); @@ -126,6 +152,8 @@ QMapbox::Feature featureFromMapItem(QDeclarativeGeoMapItemBase *item) switch (item->itemType()) { case QGeoMap::MapRectangle: return featureFromMapRectangle(static_cast<QDeclarativeRectangleMapItem *>(item)); + case QGeoMap::MapCircle: + return featureFromMapCircle(static_cast<QDeclarativeCircleMapItem *>(item)); case QGeoMap::MapPolygon: return featureFromMapPolygon(static_cast<QDeclarativePolygonMapItem *>(item)); case QGeoMap::MapPolyline: @@ -182,6 +210,7 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::addMapItem(QDe switch (item->itemType()) { case QGeoMap::MapRectangle: + case QGeoMap::MapCircle: case QGeoMap::MapPolygon: case QGeoMap::MapPolyline: break; @@ -250,13 +279,20 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fro QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fromMapItem(QDeclarativeGeoMapItemBase *item) { + QList<QSharedPointer<QMapboxGLStyleChange>> changes; + switch (item->itemType()) { case QGeoMap::MapPolyline: - return fromMapItem(static_cast<QDeclarativePolylineMapItem *>(item)); + changes = fromMapItem(static_cast<QDeclarativePolylineMapItem *>(item)); default: - qWarning() << "Unsupported QGeoMap item type: " << item->itemType(); - return QList<QSharedPointer<QMapboxGLStyleChange>>(); + break; } + + changes << QSharedPointer<QMapboxGLStyleChange>( + new QMapboxGLStyleSetLayoutProperty(getId(item), QStringLiteral("visibility"), + item->isVisible() ? QStringLiteral("visible") : QStringLiteral("none"))); + + return changes; } QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fromMapItem(QDeclarativePolylineMapItem *item) @@ -325,6 +361,8 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from switch (item->itemType()) { case QGeoMap::MapRectangle: return fromMapItem(static_cast<QDeclarativeRectangleMapItem *>(item)); + case QGeoMap::MapCircle: + return fromMapItem(static_cast<QDeclarativeCircleMapItem *>(item)); case QGeoMap::MapPolygon: return fromMapItem(static_cast<QDeclarativePolygonMapItem *>(item)); case QGeoMap::MapPolyline: @@ -352,6 +390,23 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::from return changes; } +QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::fromMapItem(QDeclarativeCircleMapItem *item) +{ + QList<QSharedPointer<QMapboxGLStyleChange>> changes; + changes.reserve(3); + + const QString id = getId(item); + + changes << QSharedPointer<QMapboxGLStyleChange>( + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-opacity"), item->mapItemOpacity())); + changes << QSharedPointer<QMapboxGLStyleChange>( + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-color"), item->color())); + changes << QSharedPointer<QMapboxGLStyleChange>( + new QMapboxGLStyleSetPaintProperty(id, QStringLiteral("fill-outline-color"), item->border()->color())); + + return changes; +} + QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::fromMapItem(QDeclarativePolygonMapItem *item) { QList<QSharedPointer<QMapboxGLStyleChange>> changes; diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h index aa81d89f..33737c1d 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h @@ -93,6 +93,7 @@ public: private: static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeRectangleMapItem *); + static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeCircleMapItem *); static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativePolygonMapItem *); static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativePolylineMapItem *); diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp index d338a51a..82aa868f 100644 --- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp +++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp @@ -65,6 +65,7 @@ void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio) m_map->resize(minSize, fbSize); m_fbo.reset(new QOpenGLFramebufferObject(fbSize, QOpenGLFramebufferObject::CombinedDepthStencil)); + m_map->setFramebufferObject(m_fbo->handle()); QSGPlainTexture *fboTexture = static_cast<QSGPlainTexture *>(texture()); if (!fboTexture) @@ -87,10 +88,16 @@ void QSGMapboxGLTextureNode::render(QQuickWindow *window) QOpenGLFunctions *f = window->openglContext()->functions(); f->glViewport(0, 0, m_fbo->width(), m_fbo->height()); + GLint alignment; + f->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); + m_fbo->bind(); m_map->render(); m_fbo->release(); + // QTBUG-62861 + f->glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); + window->resetOpenGLState(); markDirty(QSGNode::DirtyMaterial); } @@ -124,7 +131,13 @@ void QSGMapboxGLRenderNode::render(const RenderState *state) f->glScissor(state->scissorRect().x(), state->scissorRect().y(), state->scissorRect().width(), state->scissorRect().height()); f->glEnable(GL_SCISSOR_TEST); + GLint alignment; + f->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); + m_map->render(); + + // QTBUG-62861 + f->glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); } QSGRenderNode::StateFlags QSGMapboxGLRenderNode::changedStates() const diff --git a/src/plugins/position/android/jar/bundledjar.pro b/src/plugins/position/android/jar/bundledjar.pro deleted file mode 100644 index e7bd106d..00000000 --- a/src/plugins/position/android/jar/bundledjar.pro +++ /dev/null @@ -1,3 +0,0 @@ -TARGET = QtPositioning-bundled -CONFIG += bundled_jar_file -include(jar.pri) diff --git a/src/plugins/position/android/jar/distributedjar.pro b/src/plugins/position/android/jar/distributedjar.pro deleted file mode 100644 index 4a5faaa4..00000000 --- a/src/plugins/position/android/jar/distributedjar.pro +++ /dev/null @@ -1,3 +0,0 @@ -TARGET = QtPositioning -include(jar.pri) - diff --git a/src/plugins/position/android/jar/jar.pri b/src/plugins/position/android/jar/jar.pri deleted file mode 100644 index 9fa548ff..00000000 --- a/src/plugins/position/android/jar/jar.pri +++ /dev/null @@ -1,14 +0,0 @@ -load(qt_build_paths) - -CONFIG += java -DESTDIR = $$MODULE_BASE_OUTDIR/jar - -JAVACLASSPATH += $$PWD/src - -JAVASOURCES += \ - $$PWD/src/org/qtproject/qt5/android/positioning/QtPositioning.java - -# install -target.path = $$[QT_INSTALL_PREFIX]/jar -INSTALLS += target - diff --git a/src/plugins/position/android/jar/jar.pro b/src/plugins/position/android/jar/jar.pro index 8d19c1b7..661f172e 100644 --- a/src/plugins/position/android/jar/jar.pro +++ b/src/plugins/position/android/jar/jar.pro @@ -1,2 +1,16 @@ -TEMPLATE = subdirs -SUBDIRS += bundledjar.pro distributedjar.pro +TARGET = QtPositioning + +load(qt_build_paths) + +CONFIG += java +DESTDIR = $$MODULE_BASE_OUTDIR/jar + +JAVACLASSPATH += $$PWD/src + +JAVASOURCES += \ + $$PWD/src/org/qtproject/qt5/android/positioning/QtPositioning.java + +# install +target.path = $$[QT_INSTALL_PREFIX]/jar +INSTALLS += target + diff --git a/src/positioning/configure.json b/src/positioning/configure.json index 22b77be6..49e32be4 100644 --- a/src/positioning/configure.json +++ b/src/positioning/configure.json @@ -38,7 +38,7 @@ "summary": [ { - "section": "Qt Location", + "section": "Qt Positioning", "entries": [ "gypsy", "winrt_geolocation" diff --git a/src/positioning/positioning.pro b/src/positioning/positioning.pro index 974a8d48..49cb9b48 100644 --- a/src/positioning/positioning.pro +++ b/src/positioning/positioning.pro @@ -10,8 +10,6 @@ QMAKE_DOCS = $$PWD/doc/qtpositioning.qdocconf OTHER_FILES += doc/src/*.qdoc # show .qdoc files in Qt Creator ANDROID_BUNDLED_JAR_DEPENDENCIES = \ - jar/QtPositioning-bundled.jar:org.qtproject.qt5.android.positioning.QtPositioning -ANDROID_JAR_DEPENDENCIES = \ jar/QtPositioning.jar:org.qtproject.qt5.android.positioning.QtPositioning ANDROID_PERMISSIONS = \ android.permission.ACCESS_FINE_LOCATION diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index d97af779..1229874a 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -62,9 +62,6 @@ qtHaveModule(location) { declarative_geoshape !mac: SUBDIRS += declarative_ui - - # QTBUG-60268 - boot2qt: SUBDIRS -= declarative_ui } } diff --git a/tests/auto/declarative_core/tst_plugin.qml b/tests/auto/declarative_core/tst_plugin.qml index 3dabba07..7b880f1d 100644 --- a/tests/auto/declarative_core/tst_plugin.qml +++ b/tests/auto/declarative_core/tst_plugin.qml @@ -99,9 +99,14 @@ Item { verify(invalidPlugin.supportsRouting()) verify(invalidPlugin.supportsPlaces()) - invalidPlugin.name = '' + invalidPlugin.name = 'here' compare(invalidAttachedSpy.count, 2) + verify(invalidPlugin.supportsMapping(Plugin.OnlineMappingFeature)) + verify(invalidPlugin.supportsGeocoding(Plugin.OnlineGeocodingFeature)) + verify(invalidPlugin.supportsRouting(Plugin.OnlineRoutingFeature)) + invalidPlugin.name = '' + compare(invalidAttachedSpy.count, 2) verify(!invalidPlugin.supportsMapping()) verify(!invalidPlugin.supportsGeocoding()) verify(!invalidPlugin.supportsRouting()) diff --git a/tests/auto/declarative_ui/tst_map.qml b/tests/auto/declarative_ui/tst_map.qml index a6c10c22..52dcac11 100644 --- a/tests/auto/declarative_ui/tst_map.qml +++ b/tests/auto/declarative_ui/tst_map.qml @@ -50,6 +50,20 @@ Item { } ] } + Plugin { + id: testPluginLazyParameter; + name: "qmlgeo.test.plugin" + allowExperimental: true + property string extraTypeName : undefined + PluginParameter { name: "supported"; value: true} + PluginParameter { name: "finishRequestImmediately"; value: true} + PluginParameter { name: "validateWellKnownValues"; value: true} + PluginParameter { name: "extraMapTypeName"; value: testPluginLazyParameter.extraTypeName} + + Component.onCompleted: { + extraTypeName = "SomeString" + } + } property variant coordinate1: QtPositioning.coordinate(10, 11) property variant coordinate2: QtPositioning.coordinate(12, 13) @@ -106,6 +120,11 @@ Item { Map {id: mapTiltBearingHere; plugin: herePlugin; center: coordinate1; width: 1000; height: 1000; zoomLevel: 4; bearing: 45.0; tilt: 25.0 } + Map { + id: mapWithLazyPlugin + plugin: testPluginLazyParameter + } + MapParameter { id: testParameter type: "cameraCenter_test" @@ -129,6 +148,11 @@ Item { mapCenterSpy.clear(); } + function test_lazy_parameter() { + compare(mapWithLazyPlugin.supportedMapTypes.length, 5) + compare(mapWithLazyPlugin.supportedMapTypes[4].name, "SomeString") + } + function test_map_center() { // coordinate is set at map element declaration compare(map.center.latitude, 10) diff --git a/tests/auto/declarative_ui/tst_map_flick.qml b/tests/auto/declarative_ui/tst_map_flick.qml index c153411f..ba10d12e 100644 --- a/tests/auto/declarative_ui/tst_map_flick.qml +++ b/tests/auto/declarative_ui/tst_map_flick.qml @@ -170,7 +170,7 @@ Item { map.center.longitude = 11 mousePress(page, 0, 50) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, 0, (50 + i), 0, Qt.LeftButton); } mouseRelease(page, 0, 100) @@ -207,7 +207,7 @@ Item { map.center.longitude = 11 mousePress(page, 10, 95) for (var i = 45; i > 0; i -= 5) { - wait(20) + wait(25) mouseMove(page, 10, (50 + i), 0, Qt.LeftButton); } mouseRelease(page, 10, 50) @@ -242,7 +242,7 @@ Item { mousePress(page, pos, pos) for (var i = pos; i < 50; i += 5) { pos = i - wait(20) + wait(25) mouseMove(page, pos, pos, 0, Qt.LeftButton); } mouseRelease(page, pos, pos) @@ -263,7 +263,7 @@ Item { map.center.longitude = 50 mousePress(page, 0, 0) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, i, i, 0, Qt.LeftButton); } mouseRelease(page, 50, 50) @@ -290,7 +290,7 @@ Item { map.center.longitude = 50 mousePress(page, 0, 0) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, i, i, 0, Qt.LeftButton); } mouseRelease(page, 50, 50) @@ -324,7 +324,7 @@ Item { map.center.longitude = 50 mousePress(page, 0, 0) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, i, i, 0, Qt.LeftButton); } mouseRelease(page, 50, 50) diff --git a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h index 0a7624ee..297be0d5 100644 --- a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h @@ -64,6 +64,7 @@ public: const QByteArray pluginName = "qmlgeo.test.plugin"; QList<QGeoMapType> mapTypes; + mapTypes << QGeoMapType(QGeoMapType::StreetMap, tr("StreetMap"), tr("StreetMap"), false, false, 1, pluginName, capabilities); mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("SatelliteMapDay"), tr("SatelliteMapDay"), false, false, 2, pluginName, capabilities); mapTypes << QGeoMapType(QGeoMapType::CycleMap, tr("CycleMap"), tr("CycleMap"), false, false, 3, pluginName, capabilities); @@ -80,6 +81,12 @@ public: QVariantMap meta; meta["foo"] = 42; mapTypes << QGeoMapType(QGeoMapType::CustomMap, tr("AlternateCameraCapabilities"), tr("AlternateCameraCapabilities"), false, false, 4, pluginName, capabilities4, meta); + + if (parameters.contains(QStringLiteral("extraMapTypeName"))) { + QString extraMapTypeName = parameters.value(QStringLiteral("extraMapTypeName")).toString(); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, extraMapTypeName, extraMapTypeName, false, false, 5, pluginName, capabilities); + } + setSupportedMapTypes(mapTypes); QGeoTileFetcherTest *fetcher = new QGeoTileFetcherTest(this); diff --git a/tests/auto/nokia_services/routing/tst_routing.cpp b/tests/auto/nokia_services/routing/tst_routing.cpp index c214556f..833c95af 100644 --- a/tests/auto/nokia_services/routing/tst_routing.cpp +++ b/tests/auto/nokia_services/routing/tst_routing.cpp @@ -234,7 +234,8 @@ void tst_nokia_routing::calculateRoute() m_routingManager->calculateRoute(m_dummyRequest); m_replyUnowned->complete(); m_replyUnowned = 0; - QTRY_VERIFY_WITH_TIMEOUT(m_calculationDone, 100); + // Timeout of 200ms is required for slow targets (e.g. Qemu) + QTRY_VERIFY_WITH_TIMEOUT(m_calculationDone, 200); } void tst_nokia_routing::onReply(QGeoRouteReply* reply) diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp index 7eb1ed51..14b40eb6 100644 --- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp +++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp @@ -134,6 +134,8 @@ void tst_QGeoTiledMap::fetchTiles() //prev_visible camera.setZoomLevel(zoomLevel-1); + // Delay needed on slow targets (e.g. Qemu) + QTest::qWait(10); m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); @@ -142,6 +144,8 @@ void tst_QGeoTiledMap::fetchTiles() //visible + prefetch camera.setZoomLevel(zoomLevel); + // Delay needed on slow targets (e.g. Qemu) + QTest::qWait(10); m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); @@ -155,6 +159,8 @@ void tst_QGeoTiledMap::fetchTiles() //next visible camera.setZoomLevel(zoomLevel + 1); + // Delay needed on slow targets (e.g. Qemu) + QTest::qWait(10); m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); |