summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-01 08:01:56 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-01 08:01:56 +0200
commit5ea190ac941ed9889de049df221b56db065529d0 (patch)
treec0b7b4b2a6bb30c4ec1a653715760c50d9e34ce9
parent5389a65dc7434c4ed269a5d0c5cb93f5b12823ba (diff)
parent5c3e3464c2ccf960ef3aaee4286f3d5b4cde12ac (diff)
downloadqtlocation-5ea190ac941ed9889de049df221b56db065529d0.tar.gz
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: .qmake.conf Change-Id: I5700c90ee86873599b5e7c9ccb6cef7ca48153e7
-rw-r--r--dist/changes-5.12.233
-rw-r--r--examples/location/mapviewer/main.cpp3
-rw-r--r--examples/location/mapviewer/mapviewer.qml13
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp58
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemview.cpp55
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemview_p.h2
-rw-r--r--src/plugins/geoservices/mapbox/qgeofiletilecachemapbox.cpp2
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp39
-rw-r--r--src/plugins/geoservices/osm/qgeotileproviderosm.cpp24
-rw-r--r--src/plugins/geoservices/osm/qgeotileproviderosm.h1
-rw-r--r--src/positioning/qgeopath.cpp4
11 files changed, 176 insertions, 58 deletions
diff --git a/dist/changes-5.12.2 b/dist/changes-5.12.2
new file mode 100644
index 00000000..d9822a3c
--- /dev/null
+++ b/dist/changes-5.12.2
@@ -0,0 +1,33 @@
+Qt 5.12.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+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.
+
+****************************************************************************
+* QtLocation *
+****************************************************************************
+
+ - [QTBUG-61509] Fixed crash when assigning a Component to MapQuickItem.sourceItem.
+ - [QTBUG-72935] Fixed QGeoRectangle::operator|=-.
+ - [QTBUG-71264] Fixed MapObjectView removing wrong indices on model changes.
+
+****************************************************************************
+* QtPositioning *
+****************************************************************************
+
+ - Several improvements in the WinRT positioning plugin.
+ - Geoclue plugin re-enabled on all *BSD.
diff --git a/examples/location/mapviewer/main.cpp b/examples/location/mapviewer/main.cpp
index 73bc937b..39c117ed 100644
--- a/examples/location/mapviewer/main.cpp
+++ b/examples/location/mapviewer/main.cpp
@@ -52,6 +52,8 @@
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQuick/QQuickItem>
+#include <QSslSocket>
+#include <QQmlContext>
static bool parseArgs(QStringList& args, QVariantMap& parameters)
{
@@ -131,6 +133,7 @@ int main(int argc, char *argv[])
parameters[QStringLiteral("osm.useragent")] = QStringLiteral("QtLocation Mapviewer example");
QQmlApplicationEngine engine;
+ engine.rootContext()->setContextProperty("supportsSsl", QSslSocket::supportsSsl());
engine.addImportPath(QStringLiteral(":/imports"));
engine.load(QUrl(QStringLiteral("qrc:///mapviewer.qml")));
QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit()));
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index e97076ab..e8b016aa 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -429,6 +429,19 @@ ApplicationWindow {
focus: true
initialItem: Item {
id: page
+
+ Text {
+ visible: !supportsSsl && map && map.activeMapType && activeMapType.metadata.isHTTPS
+ text: "The active map type\n
+requires (missing) SSL\n
+support"
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: appWindow.width / 12
+ font.bold: true
+ color: "grey"
+ anchors.centerIn: parent
+ z: 12
+ }
}
function showMessage(title,message,backPage)
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 997f8465..1b5ea11c 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -234,33 +234,45 @@ QDeclarativeGeoMap::~QDeclarativeGeoMap()
m_map->clearMapItems();
}
- // This forces the destruction of the associated items now, not when QObject destructor is called, at which point
- // QDeclarativeGeoMap is long gone
+ // Remove the items from the map, making them deletable.
+ // Go in the same order as in removeMapChild: views, groups, then items
if (!m_mapViews.isEmpty()) {
- for (QDeclarativeGeoMapItemView *v : qAsConst(m_mapViews)) {
+ const auto mapViews = m_mapViews;
+ for (QDeclarativeGeoMapItemView *v : mapViews) { // so that removeMapItemView_real can safely modify m_mapViews;
if (!v)
continue;
- if (v->parent() == this) {
- delete v;
- } else {
- // FIXME: removeInstantiatedItems should abort, as well as exit transitions terminated
- v->removeInstantiatedItems(false);
- v->m_map = nullptr;
- }
+
+ QQuickItem *parent = v->parentItem();
+ QDeclarativeGeoMapItemGroup *group = qobject_cast<QDeclarativeGeoMapItemGroup *>(parent);
+ if (group)
+ continue; // Ignore non-top-level MIVs. They will be recursively processed.
+ // Identify them as being parented by a MapItemGroup.
+
+ removeMapItemView_real(v);
}
}
- // remove any map items associations
- for (int i = 0; i < m_mapItems.count(); ++i) {
- if (m_mapItems.at(i))
- m_mapItems.at(i).data()->setMap(0,0);
- }
- // remove any map item groups associations
- for (int i = 0; i < m_mapItemGroups.count(); ++i) {
- if (m_mapItemGroups.at(i))
- m_mapItemGroups.at(i).data()->setQuickMap(nullptr);
+ if (!m_mapItemGroups.isEmpty()) {
+ const auto mapGroups = m_mapItemGroups;
+ for (QDeclarativeGeoMapItemGroup *g : mapGroups) {
+ if (!g)
+ continue;
+
+ QQuickItem *parent =g->parentItem();
+ QDeclarativeGeoMapItemGroup *group = qobject_cast<QDeclarativeGeoMapItemGroup *>(parent);
+ if (group)
+ continue; // Ignore non-top-level Groups. They will be recursively processed.
+ // Identify them as being parented by a MapItemGroup.
+
+ removeMapItemGroup_real(g);
+ }
}
+ // remove any remaining map items associations
+ const auto mapItems = m_mapItems;
+ for (auto mi: mapItems)
+ removeMapItem_real(mi.data());
+
if (m_copyrights.data())
delete m_copyrights.data();
m_copyrights.clear();
@@ -2119,14 +2131,10 @@ bool QDeclarativeGeoMap::removeMapItemView_real(QDeclarativeGeoMapItemView *item
if (!itemView || itemView->m_map != this) // can't remove a view that is already added to another map
return false;
- // Leaving this as void since the removal is async (potentially transitioned)
- // && the delegates *could* be empty mapItemGroups.
- itemView->removeInstantiatedItems();
+ itemView->removeInstantiatedItems(false); // remove the items without using transitions AND abort ongoing ones
itemView->m_map = 0;
- // it can be removed from the list at this point, since no operations that require a Map have to be done
- // anymore on destruction.
m_mapViews.removeOne(itemView);
- return removeMapItemGroup_real(itemView); // at this point, delegate instances have been removed.
+ return removeMapItemGroup_real(itemView); // at this point, all delegate instances have been removed.
}
/*!
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
index a769a0c9..3208829c 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
@@ -107,7 +107,8 @@ QDeclarativeGeoMapItemView::QDeclarativeGeoMapItemView(QQuickItem *parent)
QDeclarativeGeoMapItemView::~QDeclarativeGeoMapItemView()
{
- removeInstantiatedItems();
+ // No need to remove instantiated items: if the MIV has instantiated items because it has been added
+ // to a Map (or is child of a Map), the Map destructor takes care of removing it and the instantiated items.
}
/*!
@@ -309,7 +310,7 @@ void QDeclarativeGeoMapItemView::removeInstantiatedItems(bool transition)
if (!m_map)
return;
- // FIXME: removeInstantiatedItems should abort, as well as exit transitions terminated QTBUG-69195
+ // with transition = false removeInstantiatedItems aborts ongoing exit transitions //QTBUG-69195
// Backward as removeItemFromMap modifies m_instantiatedItems
for (int i = m_instantiatedItems.size() -1; i >= 0 ; i--)
removeDelegateFromMap(i, transition);
@@ -356,24 +357,38 @@ QList<QQuickItem *> QDeclarativeGeoMapItemView::mapItems()
return m_instantiatedItems;
}
+QQmlInstanceModel::ReleaseFlags QDeclarativeGeoMapItemView::disposeDelegate(QQuickItem *item)
+{
+ disconnect(item, 0, this, 0);
+ removeDelegateFromMap(item);
+ item->setParentItem(nullptr); // Needed because
+ item->setParent(nullptr); // m_delegateModel->release(item) does not destroy the item most of the times!!
+ QQmlInstanceModel::ReleaseFlags releaseStatus = m_delegateModel->release(item);
+ return releaseStatus;
+}
+
void QDeclarativeGeoMapItemView::removeDelegateFromMap(int index, bool transition)
{
if (index >= 0 && index < m_instantiatedItems.size()) {
QQuickItem *item = m_instantiatedItems.takeAt(index);
if (!item) { // not yet incubated
- // Don't cancel incubation explicitly, as DelegateModel apparently takes care of incubating elements when the model
- // remove those indices.
+ // Don't cancel incubation explicitly when model rows are removed, as DelegateModel
+ // apparently takes care of incubating elements when the model remove those indices.
+ // Cancel them explicitly only when a MIV is removed from a map.
+ if (!transition)
+ m_delegateModel->cancel(index);
return;
}
// item can be either a QDeclarativeGeoMapItemBase or a QDeclarativeGeoMapItemGroup (subclass)
- if (m_exit && m_map && transition) {
+ if (m_exit && m_map && transition) {
transitionItemOut(item);
} else {
- disconnect(item, 0, this, 0);
- removeDelegateFromMap(item);
- item->setParentItem(nullptr); // Needed because
- item->setParent(nullptr); // m_delegateModel->release(item) does not destroy the item most of the times!!
- QQmlInstanceModel::ReleaseFlags releaseStatus = m_delegateModel->release(item);
+ if (m_exit && m_map && !transition) {
+ // check if the exit transition is still running, if so stop it.
+ // This can happen when explicitly calling Map.removeMapItemView, soon after adding it.
+ terminateExitTransition(item);
+ }
+ QQmlInstanceModel::ReleaseFlags releaseStatus = disposeDelegate(item);
#ifdef QT_DEBUG
if (releaseStatus == QQmlInstanceModel::Referenced)
qWarning() << "item "<< index << "(" << item << ") still referenced";
@@ -436,16 +451,26 @@ void QDeclarativeGeoMapItemView::transitionItemOut(QQuickItem *o)
}
}
+void QDeclarativeGeoMapItemView::terminateExitTransition(QQuickItem *o)
+{
+ QDeclarativeGeoMapItemGroup *group = qobject_cast<QDeclarativeGeoMapItemGroup *>(o);
+ if (group && group->m_transitionManager) {
+ group->m_transitionManager->cancel();
+ return;
+ }
+ QDeclarativeGeoMapItemBase *item = qobject_cast<QDeclarativeGeoMapItemBase *>(o);
+ if (item && item->m_transitionManager) {
+ item->m_transitionManager->cancel();
+ return;
+ }
+}
+
void QDeclarativeGeoMapItemView::exitTransitionFinished()
{
QQuickItem *item = qobject_cast<QQuickItem *>(sender());
if (!item)
return;
- disconnect(item, 0, this, 0);
- removeDelegateFromMap(item);
- item->setParentItem(nullptr);
- item->setParent(nullptr);
- QQmlInstanceModel::ReleaseFlags releaseStatus = m_delegateModel->release(item);
+ QQmlInstanceModel::ReleaseFlags releaseStatus = disposeDelegate(item);
#ifdef QT_DEBUG
if (releaseStatus == QQmlInstanceModel::Referenced)
qWarning() << "item "<<item<<" still referenced";
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview_p.h b/src/location/declarativemaps/qdeclarativegeomapitemview_p.h
index 43ca685a..abac5bd5 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemview_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitemview_p.h
@@ -130,6 +130,8 @@ private:
void removeDelegateFromMap(int index, bool transition = true);
void removeDelegateFromMap(QQuickItem *o);
void transitionItemOut(QQuickItem *o);
+ void terminateExitTransition(QQuickItem *o);
+ QQmlInstanceModel::ReleaseFlags disposeDelegate(QQuickItem *item);
void insertInstantiatedItem(int index, QQuickItem *o, bool createdItem);
void addItemToMap(QDeclarativeGeoMapItemBase *item, int index, bool createdItem);
diff --git a/src/plugins/geoservices/mapbox/qgeofiletilecachemapbox.cpp b/src/plugins/geoservices/mapbox/qgeofiletilecachemapbox.cpp
index 2792ee78..3be66c72 100644
--- a/src/plugins/geoservices/mapbox/qgeofiletilecachemapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeofiletilecachemapbox.cpp
@@ -90,7 +90,7 @@ QGeoTileSpec QGeoFileTileCacheMapbox::filenameToTileSpec(const QString &filename
if (parts.length() != 3) // 3 because the map name has always a dot in it.
return QGeoTileSpec();
- QString name = parts.at(0) + parts.at(1);
+ QString name = parts.at(0) + QChar('.') + parts.at(1);
QStringList fields = name.split('-');
int length = fields.length();
diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp
index d2463106..5cbde041 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp
@@ -73,40 +73,43 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian
m_useChinaEndpoint = parameters.value(QStringLiteral("mapboxgl.china")).toBool();
}
+ QVariantMap metadata;
+ metadata["isHTTPS"] = true;
+
if (m_useChinaEndpoint) {
m_settings.setApiBaseUrl(QStringLiteral("https://api.mapbox.cn"));
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/streets-zh-v1"),
- tr("China Streets"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("China Streets"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/light-zh-v1"),
- tr("China Light"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("China Light"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/dark-zh-v1"),
- tr("China Dark"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("China Dark"), false, false, ++mapId, pluginName, cameraCaps, metadata);
} else {
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/streets-v10"),
- tr("Streets"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Streets"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/basic-v9"),
- tr("Basic"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Basic"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/bright-v9"),
- tr("Bright"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Bright"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::TerrainMap, QStringLiteral("mapbox://styles/mapbox/outdoors-v10"),
- tr("Outdoors"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Outdoors"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox://styles/mapbox/satellite-v9"),
- tr("Satellite"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Satellite"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox://styles/mapbox/satellite-streets-v10"),
- tr("Satellite Streets"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Satellite Streets"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/light-v9"),
- tr("Light"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Light"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/dark-v9"),
- tr("Dark"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Dark"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/navigation-preview-day-v2"),
- tr("Navigation Preview Day"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Navigation Preview Day"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/navigation-preview-night-v2"),
- tr("Navigation Preview Night"), false, true, ++mapId, pluginName, cameraCaps);
+ tr("Navigation Preview Night"), false, true, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::CarNavigationMap, QStringLiteral("mapbox://styles/mapbox/navigation-guidance-day-v2"),
- tr("Navigation Guidance Day"), false, false, ++mapId, pluginName, cameraCaps);
+ tr("Navigation Guidance Day"), false, false, ++mapId, pluginName, cameraCaps, metadata);
mapTypes << QGeoMapType(QGeoMapType::CarNavigationMap, QStringLiteral("mapbox://styles/mapbox/navigation-guidance-night-v2"),
- tr("Navigation Guidance Night"), false, true, ++mapId, pluginName, cameraCaps);
+ tr("Navigation Guidance Night"), false, true, ++mapId, pluginName, cameraCaps, metadata);
}
if (parameters.contains(QStringLiteral("mapboxgl.mapping.additional_style_urls"))) {
@@ -116,9 +119,13 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian
for (auto it = idList.crbegin(), end = idList.crend(); it != end; ++it) {
if ((*it).isEmpty())
continue;
+ if ((*it).startsWith(QStringLiteral("http:")))
+ metadata["isHTTPS"] = false;
+ else
+ metadata["isHTTPS"] = true;
mapTypes.prepend(QGeoMapType(QGeoMapType::CustomMap, *it,
- tr("User provided style"), false, false, ++mapId, pluginName, cameraCaps));
+ tr("User provided style"), false, false, ++mapId, pluginName, cameraCaps, metadata));
}
}
diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
index c0837024..f52968b0 100644
--- a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
+++ b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
@@ -45,6 +45,16 @@ QT_BEGIN_NAMESPACE
static const int maxValidZoom = 30;
static const QDateTime defaultTs = QDateTime::fromString(QStringLiteral("2016-06-01T00:00:00"), Qt::ISODate);
+static void setSSL(QGeoMapType &mapType, bool isHTTPS)
+{
+ QVariantMap metadata = mapType.metadata();
+ metadata["isHTTPS"] = isHTTPS;
+
+ mapType = QGeoMapType(mapType.style(), mapType.name(), mapType.description(), mapType.mobile(),
+ mapType.night(), mapType.mapId(), mapType.pluginName(), mapType.cameraCapabilities(),
+ metadata);
+}
+
QGeoTileProviderOsm::QGeoTileProviderOsm(QNetworkAccessManager *nm,
const QGeoMapType &mapType,
const QVector<TileProvider *> &providers,
@@ -61,6 +71,9 @@ QGeoTileProviderOsm::QGeoTileProviderOsm(QNetworkAccessManager *nm,
if (!m_provider || m_provider->isValid())
m_status = Resolved;
+ if (m_provider && m_provider->isValid())
+ setSSL(m_mapType, m_provider->isHTTPS());
+
connect(this, &QGeoTileProviderOsm::resolutionFinished, this, &QGeoTileProviderOsm::updateCameraCapabilities);
}
@@ -237,7 +250,11 @@ void QGeoTileProviderOsm::updateCameraCapabilities()
m_cameraCapabilities.setMaximumZoomLevel(maximumZoomLevel());
m_mapType = QGeoMapType(m_mapType.style(), m_mapType.name(), m_mapType.description(), m_mapType.mobile(),
- m_mapType.night(), m_mapType.mapId(), m_mapType.pluginName(), m_cameraCapabilities);
+ m_mapType.night(), m_mapType.mapId(), m_mapType.pluginName(), m_cameraCapabilities,
+ m_mapType.metadata());
+
+ if (m_provider && m_provider->isValid())
+ setSSL(m_mapType, m_provider->isHTTPS());
}
void QGeoTileProviderOsm::addProvider(TileProvider *provider)
@@ -604,6 +621,11 @@ bool TileProvider::isHighDpi() const
return m_highDpi;
}
+bool TileProvider::isHTTPS() const
+{
+ return m_urlTemplate.startsWith(QStringLiteral("https"));
+}
+
void TileProvider::setStyleCopyRight(const QString &copyright)
{
m_copyRightStyle = copyright;
diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.h b/src/plugins/geoservices/osm/qgeotileproviderosm.h
index 54f8049d..ab4e2294 100644
--- a/src/plugins/geoservices/osm/qgeotileproviderosm.h
+++ b/src/plugins/geoservices/osm/qgeotileproviderosm.h
@@ -93,6 +93,7 @@ public:
inline int maximumZoomLevel() const;
inline const QDateTime &timestamp() const;
inline bool isHighDpi() const;
+ inline bool isHTTPS() const;
QUrl tileAddress(int x, int y, int z) const;
// Optional properties, not needed to construct a provider
diff --git a/src/positioning/qgeopath.cpp b/src/positioning/qgeopath.cpp
index 843b3f1b..1225d7c8 100644
--- a/src/positioning/qgeopath.cpp
+++ b/src/positioning/qgeopath.cpp
@@ -292,6 +292,10 @@ QGeoPath QGeoPath::translated(double degreesLatitude, double degreesLongitude) c
/*!
Returns the length of the path, in meters, from the element \a indexFrom to the element \a indexTo.
The length is intended to be the sum of the shortest distances for each pair of adjacent points.
+
+ If \a indexTo is -1 (the default value), the length will be including the distance between last coordinate
+ and the first (closed loop).
+ To retrieve the length for the path, use 0 for \a indexFrom and \l QGeoPath::size() - 1 for \a indexTo.
*/
double QGeoPath::length(int indexFrom, int indexTo) const
{