summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/location/mapviewer/mapviewer.pro3
-rw-r--r--src/location/declarativemaps/qdeclarativecirclemapitem.cpp12
-rw-r--r--src/location/declarativemaps/qdeclarativecirclemapitem_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemview.cpp10
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp4
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem.cpp4
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem_p.h2
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp2
-rw-r--r--src/location/labs/qdeclarativenavigator.cpp5
-rw-r--r--src/location/labs/qdeclarativenavigator_p.h2
-rw-r--r--src/location/labs/qdeclarativenavigator_p_p.h2
-rw-r--r--src/location/labs/qsg/qmapcircleobjectqsg.cpp22
-rw-r--r--src/location/labs/qsg/qmapcircleobjectqsg_p_p.h4
-rw-r--r--src/location/labs/qsg/qmaprouteobjectqsg.cpp6
-rw-r--r--src/location/labs/qsg/qmaprouteobjectqsg_p_p.h2
-rw-r--r--src/location/maps/qgeocameratiles.cpp4
-rw-r--r--src/location/maps/qgeocameratiles_p.h2
-rw-r--r--src/location/maps/qgeocameratiles_p_p.h2
-rw-r--r--src/location/maps/qgeoroute.cpp5
-rw-r--r--src/location/maps/qgeoroute_p.h2
-rw-r--r--src/location/maps/qgeorouteparserosrmv5.cpp2
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp2
-rw-r--r--src/location/maps/qgeotiledmapscene.cpp10
-rw-r--r--src/location/maps/qgeotilerequestmanager_p.h2
-rw-r--r--src/location/maps/qnavigationmanagerengine_p.h4
-rw-r--r--src/plugins/geoservices/esri/georoutejsonparser_esri.cpp6
-rw-r--r--src/plugins/geoservices/esri/placemanagerengine_esri.cpp6
-rw-r--r--src/plugins/geoservices/mapbox/qgeocodereplymapbox.cpp2
-rw-r--r--src/plugins/geoservices/mapbox/qgeoroutingmanagerenginemapbox.cpp6
-rw-r--r--src/plugins/geoservices/mapbox/qmapboxcommon.cpp4
-rw-r--r--src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp2
-rw-r--r--src/plugins/geoservices/mapbox/qplacesearchsuggestionreplymapbox.cpp2
-rw-r--r--src/plugins/geoservices/mapboxgl/qsgmapboxglnode.h6
-rw-r--r--src/plugins/geoservices/nokia/qgeocodejsonparser.cpp16
-rw-r--r--src/plugins/geoservices/osm/qgeotileproviderosm.cpp4
-rw-r--r--tests/auto/geotestplugin/qgeotilefetcher_test.h6
-rw-r--r--tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp6
-rw-r--r--tests/auto/qmlinterface/tst_qmlinterface.cpp2
45 files changed, 98 insertions, 101 deletions
diff --git a/examples/location/mapviewer/mapviewer.pro b/examples/location/mapviewer/mapviewer.pro
index a5cbbecb..a8a868b8 100644
--- a/examples/location/mapviewer/mapviewer.pro
+++ b/examples/location/mapviewer/mapviewer.pro
@@ -6,8 +6,7 @@ SOURCES += main.cpp
# Workaround for QTBUG-38735
QT_FOR_CONFIG += location-private
-qtConfig(geoservices_mapboxgl): QT += sql
-qtConfig(geoservices_osm): QT += concurrent
+QT += concurrent sql
RESOURCES += \
mapviewer.qrc
diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
index 1a4a1ade..8044ccac 100644
--- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
@@ -452,12 +452,12 @@ void QDeclarativeCircleMapItem::possiblySwitchBackend(const QGeoCoordinate &oldC
// if old does not cross and new crosses, move to CPU.
if (!QDeclarativeCircleMapItemPrivate::crossEarthPole(oldCenter, oldRadius)
&& !QDeclarativeCircleMapItemPrivate::crossEarthPole(newCenter, newRadius)) {
- QScopedPointer<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateCPU(*this)));
- m_d.swap(d);
+ std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateCPU(*this)));
+ std::swap(m_d, d);
} else if (QDeclarativeCircleMapItemPrivate::crossEarthPole(oldCenter, oldRadius)
&& !QDeclarativeCircleMapItemPrivate::crossEarthPole(newCenter, newRadius)) { // else if old crosses and new does not cross, move back to OpenGL
- QScopedPointer<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
- m_d.swap(d);
+ std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
+ std::swap(m_d, d);
}
}
@@ -534,12 +534,12 @@ void QDeclarativeCircleMapItem::setBackend(QDeclarativeCircleMapItem::Backend b)
if (b == m_backend)
return;
m_backend = b;
- QScopedPointer<QDeclarativeCircleMapItemPrivate> d(
+ std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(
(m_backend == Software) ? static_cast<QDeclarativeCircleMapItemPrivate *>(
new QDeclarativeCircleMapItemPrivateCPU(*this))
: static_cast<QDeclarativeCircleMapItemPrivate *>(
new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
- m_d.swap(d);
+ std::swap(m_d, d);
m_d->onGeoGeometryChanged();
emit backendChanged();
}
diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem_p.h b/src/location/declarativemaps/qdeclarativecirclemapitem_p.h
index cf8038c0..b02e8542 100644
--- a/src/location/declarativemaps/qdeclarativecirclemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativecirclemapitem_p.h
@@ -129,7 +129,7 @@ private:
bool m_updatingGeometry;
Backend m_backend = Software;
- QScopedPointer<QDeclarativeCircleMapItemPrivate> m_d;
+ std::unique_ptr<QDeclarativeCircleMapItemPrivate> m_d;
friend class QDeclarativeCircleMapItemPrivate;
friend class QDeclarativeCircleMapItemPrivateCPU;
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index fd7e7351..d239934b 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -2428,7 +2428,7 @@ void QDeclarativeGeoMap::fitViewportToMapItemsRefine(const QList<QPointer<QDecla
QRectF brect = item->boundingRect();
brect = quickItem->matrix_->m_matrix.mapRect(brect);
- QPointF transformedPosition = quickItem->matrix_->m_matrix * item->position();
+ QPointF transformedPosition = quickItem->matrix_->m_matrix.map(item->position());
topLeftX = transformedPosition.x();
topLeftY = transformedPosition.y();
bottomRightX = topLeftX + brect.width();
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
index be7cfc77..de784a52 100644
--- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice.cpp
@@ -247,7 +247,7 @@ void QDeclarativeGeoMapCopyrightNotice::rasterizeHtmlAndUpdate()
m_copyrightsImage.fill(qPremultiply(QColor(Qt::transparent).rgba()));
QPainter painter(&m_copyrightsImage);
QAbstractTextDocumentLayout::PaintContext ctx;
- ctx.palette.setColor(QPalette::Text, QStringLiteral("black"));
+ ctx.palette.setColor(QPalette::Text, QColor::fromString("black"));
m_copyrightsHtml->documentLayout()->draw(&painter, ctx);
setImplicitSize(m_copyrightsImage.width(), m_copyrightsImage.height());
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
index 4d7234c7..d1166291 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
@@ -166,7 +166,7 @@ private:
QDeclarativeGeoMapItemGroup *parentGroup_;
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
bool m_autoFadeIn = true;
int m_lodThreshold = 0;
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h b/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h
index a125ba0c..58bf887d 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitemgroup_p.h
@@ -87,7 +87,7 @@ protected slots:
private:
QDeclarativeGeoMap *m_quickMap;
QDeclarativeGeoMapItemGroup *m_parentGroup = nullptr;
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
friend class QDeclarativeGeoMapItemView;
friend class QDeclarativeGeoMapItemTransitionManager;
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
index f813cf91..0969a8ac 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
@@ -428,7 +428,7 @@ void QDeclarativeGeoMapItemView::transitionItemOut(QQuickItem *o)
QDeclarativeGeoMapItemGroup *group = qobject_cast<QDeclarativeGeoMapItemGroup *>(o);
if (group) {
if (!group->m_transitionManager) {
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager>manager(new QDeclarativeGeoMapItemTransitionManager(group));
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager>manager(new QDeclarativeGeoMapItemTransitionManager(group));
group->m_transitionManager.swap(manager);
group->m_transitionManager->m_view = this;
}
@@ -441,7 +441,7 @@ void QDeclarativeGeoMapItemView::transitionItemOut(QQuickItem *o)
QDeclarativeGeoMapItemBase *item = qobject_cast<QDeclarativeGeoMapItemBase *>(o);
if (item) {
if (!item->m_transitionManager) {
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager> manager(new QDeclarativeGeoMapItemTransitionManager(item));
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager> manager(new QDeclarativeGeoMapItemTransitionManager(item));
item->m_transitionManager.swap(manager);
item->m_transitionManager->m_view = this;
}
@@ -493,7 +493,7 @@ void QDeclarativeGeoMapItemView::addItemToMap(QDeclarativeGeoMapItemBase *item,
m_map->addMapItem(item);
if (m_enter) {
if (!item->m_transitionManager) {
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager>manager(new QDeclarativeGeoMapItemTransitionManager(item));
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager>manager(new QDeclarativeGeoMapItemTransitionManager(item));
item->m_transitionManager.swap(manager);
}
item->m_transitionManager->m_view = this;
@@ -521,7 +521,7 @@ void QDeclarativeGeoMapItemView::addItemViewToMap(QDeclarativeGeoMapItemView *it
m_map->addMapItemView(item);
if (m_enter) {
if (!item->m_transitionManager) {
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager> manager(new QDeclarativeGeoMapItemTransitionManager(item));
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager> manager(new QDeclarativeGeoMapItemTransitionManager(item));
item->m_transitionManager.swap(manager);
}
item->m_transitionManager->m_view = this;
@@ -541,7 +541,7 @@ void QDeclarativeGeoMapItemView::addItemGroupToMap(QDeclarativeGeoMapItemGroup *
m_map->addMapItemGroup(item);
if (m_enter) {
if (!item->m_transitionManager) {
- QScopedPointer<QDeclarativeGeoMapItemTransitionManager>manager(new QDeclarativeGeoMapItemTransitionManager(item));
+ std::unique_ptr<QDeclarativeGeoMapItemTransitionManager>manager(new QDeclarativeGeoMapItemTransitionManager(item));
item->m_transitionManager.swap(manager);
}
item->m_transitionManager->m_view = this;
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
index 0b6a01b0..84b8b296 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
@@ -689,12 +689,12 @@ void QDeclarativePolygonMapItem::setBackend(QDeclarativePolygonMapItem::Backend
if (b == m_backend)
return;
m_backend = b;
- QScopedPointer<QDeclarativePolygonMapItemPrivate> d(
+ std::unique_ptr<QDeclarativePolygonMapItemPrivate> d(
(m_backend == Software) ? static_cast<QDeclarativePolygonMapItemPrivate *>(
new QDeclarativePolygonMapItemPrivateCPU(*this))
: static_cast<QDeclarativePolygonMapItemPrivate *>(
new QDeclarativePolygonMapItemPrivateOpenGL(*this)));
- m_d.swap(d);
+ std::swap(m_d, d);
m_d->onGeoGeometryChanged();
emit backendChanged();
}
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
index 39e5225d..d3b8d67d 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
@@ -126,7 +126,7 @@ public:
// bool m_dirtyGeometry = false;
bool m_updatingGeometry;
- QScopedPointer<QDeclarativePolygonMapItemPrivate> m_d;
+ std::unique_ptr<QDeclarativePolygonMapItemPrivate> m_d;
friend class QDeclarativePolygonMapItemPrivate;
friend class QDeclarativePolygonMapItemPrivateCPU;
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
index 278c3251..6c7dabd2 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
@@ -1215,7 +1215,7 @@ void QDeclarativePolylineMapItem::setBackend(QDeclarativePolylineMapItem::Backen
if (b == m_backend)
return;
m_backend = b;
- QScopedPointer<QDeclarativePolylineMapItemPrivate> d(
+ std::unique_ptr<QDeclarativePolylineMapItemPrivate> d(
(m_backend == Software)
? static_cast<QDeclarativePolylineMapItemPrivate *>(
new QDeclarativePolylineMapItemPrivateCPU(*this))
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h b/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
index 2f6874d1..8f52c17a 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
@@ -160,7 +160,7 @@ public:
bool m_dirtyMaterial;
bool m_updatingGeometry;
- QScopedPointer<QDeclarativePolylineMapItemPrivate> m_d;
+ std::unique_ptr<QDeclarativePolylineMapItemPrivate> m_d;
friend class QDeclarativePolylineMapItemPrivate;
friend class QDeclarativePolylineMapItemPrivateCPU;
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
index dc941a3f..2e24a112 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
@@ -188,13 +188,13 @@ void QDeclarativeRectangleMapItem::setBackend(QDeclarativeRectangleMapItem::Back
if (b == m_backend)
return;
m_backend = b;
- QScopedPointer<QDeclarativeRectangleMapItemPrivate> d(
+ std::unique_ptr<QDeclarativeRectangleMapItemPrivate> d(
(m_backend == Software) ? static_cast<QDeclarativeRectangleMapItemPrivate *>(
new QDeclarativeRectangleMapItemPrivateCPU(*this))
: static_cast<QDeclarativeRectangleMapItemPrivate *>(
new QDeclarativeRectangleMapItemPrivateOpenGL(*this)));
- m_d.swap(d);
+ std::swap(m_d, d);
m_d->onGeoGeometryChanged();
emit backendChanged();
}
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h b/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h
index 59b06822..0a5c5fa8 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h
@@ -130,7 +130,7 @@ private:
bool m_updatingGeometry;
Backend m_backend = Software;
- QScopedPointer<QDeclarativeRectangleMapItemPrivate> m_d;
+ std::unique_ptr<QDeclarativeRectangleMapItemPrivate> m_d;
friend class QDeclarativeRectangleMapItemPrivate;
friend class QDeclarativeRectangleMapItemPrivateCPU;
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
index 4fd1448c..e46e5b26 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp
+++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
@@ -1819,7 +1819,7 @@ void QQuickGeoMapGestureArea::startFlick(int dx, int dy, int timeMs)
QPointF delta(dx, dy);
QMatrix4x4 matBearing;
matBearing.rotate(m_map->cameraData().bearing(), 0, 0, 1);
- delta = matBearing * delta;
+ delta = matBearing.map(delta);
double zoom = pow(2.0, m_declarativeMap->zoomLevel());
double longitude = animationStartCoordinate.longitude() - (delta.x() / zoom);
diff --git a/src/location/labs/qdeclarativenavigator.cpp b/src/location/labs/qdeclarativenavigator.cpp
index 546d0b01..d4374719 100644
--- a/src/location/labs/qdeclarativenavigator.cpp
+++ b/src/location/labs/qdeclarativenavigator.cpp
@@ -392,8 +392,7 @@ void QDeclarativeNavigator::recalculateRoutes()
*/
QAbstractNavigator *QDeclarativeNavigator::abstractNavigator() const
{
- return d_ptr->m_navigator.data();
-
+ return d_ptr->m_navigator.get();
}
bool QDeclarativeNavigator::active() const
@@ -567,7 +566,7 @@ QDeclarativeNavigationBasicDirections::QDeclarativeNavigationBasicDirections(QDe
: QObject(parent), m_navigator(parent), m_routes(QByteArrayLiteral("routeData"), this)
{
if (m_navigator)
- m_navigatorPrivate = m_navigator->d_ptr.data();
+ m_navigatorPrivate = m_navigator->d_ptr.get();
}
/*!
diff --git a/src/location/labs/qdeclarativenavigator_p.h b/src/location/labs/qdeclarativenavigator_p.h
index 29895afd..17282c74 100644
--- a/src/location/labs/qdeclarativenavigator_p.h
+++ b/src/location/labs/qdeclarativenavigator_p.h
@@ -181,7 +181,7 @@ protected:
void setError(NavigationError error, const QString &errorString);
private:
- QScopedPointer<QDeclarativeNavigatorPrivate> d_ptr;
+ std::unique_ptr<QDeclarativeNavigatorPrivate> d_ptr;
friend class QDeclarativeNavigatorPrivate;
friend class QDeclarativeNavigationBasicDirections;
diff --git a/src/location/labs/qdeclarativenavigator_p_p.h b/src/location/labs/qdeclarativenavigator_p_p.h
index 640d7785..354b1c97 100644
--- a/src/location/labs/qdeclarativenavigator_p_p.h
+++ b/src/location/labs/qdeclarativenavigator_p_p.h
@@ -194,7 +194,7 @@ public:
QParameterizableObject *q = nullptr;
QSharedPointer<QDeclarativeNavigatorParams> m_params;
- QScopedPointer<QAbstractNavigator> m_navigator;
+ std::unique_ptr<QAbstractNavigator> m_navigator;
QDeclarativeGeoServiceProvider *m_plugin = nullptr;
QDeclarativeNavigationBasicDirections m_basicDirections;
diff --git a/src/location/labs/qsg/qmapcircleobjectqsg.cpp b/src/location/labs/qsg/qmapcircleobjectqsg.cpp
index 6935beff..3cf98907 100644
--- a/src/location/labs/qsg/qmapcircleobjectqsg.cpp
+++ b/src/location/labs/qsg/qmapcircleobjectqsg.cpp
@@ -70,7 +70,7 @@ QMapCircleObjectPrivateQSG::~QMapCircleObjectPrivateQSG()
void QMapCircleObjectPrivateQSG::updateGeometry()
{
- if (!m_dataGL.isNull())
+ if (m_dataGL)
updateGeometryGL();
else
updateGeometryCPU();
@@ -202,9 +202,9 @@ QGeoMapObjectPrivate *QMapCircleObjectPrivateQSG::clone()
void QMapCircleObjectPrivateQSG::switchToGL()
{
- if (!m_dataGL.isNull())
+ if (m_dataGL)
return;
- QScopedPointer<CircleDataGL> data(new CircleDataGL);
+ std::unique_ptr<CircleDataGL> data(new CircleDataGL);
m_dataGL.swap(data);
m_dataGL->markSourceDirty();
m_dataCPU.reset(nullptr);
@@ -212,9 +212,9 @@ void QMapCircleObjectPrivateQSG::switchToGL()
void QMapCircleObjectPrivateQSG::switchToCPU()
{
- if (!m_dataCPU.isNull())
+ if (m_dataCPU)
return;
- QScopedPointer<CircleDataCPU> data(new CircleDataCPU);
+ std::unique_ptr<CircleDataCPU> data(new CircleDataCPU);
m_dataCPU.swap(data);
m_dataGL.reset(nullptr);
}
@@ -224,7 +224,7 @@ QSGNode *QMapCircleObjectPrivateQSG::updateMapObjectNode(QSGNode *oldNode,
QSGNode *root,
QQuickWindow * window)
{
- if (!m_dataGL.isNull())
+ if (m_dataGL)
return updateMapObjectNodeGL(oldNode, visibleNode, root, window);
else
return updateMapObjectNodeCPU(oldNode, visibleNode, root, window);
@@ -337,7 +337,7 @@ void QMapCircleObjectPrivateQSG::setCenter(const QGeoCoordinate &center)
else
switchToCPU();
- if (!m_dataGL.isNull())
+ if (m_dataGL)
m_dataGL->markSourceDirty();
updateGeometry();
@@ -353,7 +353,7 @@ void QMapCircleObjectPrivateQSG::setRadius(qreal radius)
else
switchToCPU();
- if (!m_dataGL.isNull())
+ if (m_dataGL)
m_dataGL->markSourceDirty();
updateGeometry();
@@ -364,7 +364,7 @@ void QMapCircleObjectPrivateQSG::setRadius(qreal radius)
void QMapCircleObjectPrivateQSG::setColor(const QColor &color)
{
QMapCircleObjectPrivateDefault::setColor(color);
- if (!m_dataCPU.isNull())
+ if (m_dataCPU)
updateGeometry();
if (m_map)
emit m_map->sgNodeChanged();
@@ -373,7 +373,7 @@ void QMapCircleObjectPrivateQSG::setColor(const QColor &color)
void QMapCircleObjectPrivateQSG::setBorderColor(const QColor &color)
{
QMapCircleObjectPrivateDefault::setBorderColor(color);
- if (!m_dataCPU.isNull())
+ if (m_dataCPU)
updateGeometry();
if (m_map)
emit m_map->sgNodeChanged();
@@ -382,7 +382,7 @@ void QMapCircleObjectPrivateQSG::setBorderColor(const QColor &color)
void QMapCircleObjectPrivateQSG::setBorderWidth(qreal width)
{
QMapCircleObjectPrivateDefault::setBorderWidth(width);
- if (!m_dataCPU.isNull())
+ if (m_dataCPU)
updateGeometry();
if (m_map)
emit m_map->sgNodeChanged();
diff --git a/src/location/labs/qsg/qmapcircleobjectqsg_p_p.h b/src/location/labs/qsg/qmapcircleobjectqsg_p_p.h
index 9f64942e..5dd375bd 100644
--- a/src/location/labs/qsg/qmapcircleobjectqsg_p_p.h
+++ b/src/location/labs/qsg/qmapcircleobjectqsg_p_p.h
@@ -130,8 +130,8 @@ struct CircleDataGL {
m_borderGeometry.markSourceDirty();
}
};
- QScopedPointer<CircleDataCPU> m_dataCPU;
- QScopedPointer<CircleDataGL> m_dataGL;
+ std::unique_ptr<CircleDataCPU> m_dataCPU;
+ std::unique_ptr<CircleDataGL> m_dataGL;
};
QT_END_NAMESPACE
diff --git a/src/location/labs/qsg/qmaprouteobjectqsg.cpp b/src/location/labs/qsg/qmaprouteobjectqsg.cpp
index 3acb0222..b6a6881b 100644
--- a/src/location/labs/qsg/qmaprouteobjectqsg.cpp
+++ b/src/location/labs/qsg/qmaprouteobjectqsg.cpp
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
QMapRouteObjectPrivateQSG::QMapRouteObjectPrivateQSG(QGeoMapObject *q)
: QMapRouteObjectPrivate(q)
{
- QScopedPointer<QMapPolylineObjectPrivateQSG> poly(new QMapPolylineObjectPrivateQSG(q));
+ std::unique_ptr<QMapPolylineObjectPrivateQSG> poly(new QMapPolylineObjectPrivateQSG(q));
m_polyline.swap(poly);
m_polyline->m_componentCompleted = true;
}
@@ -52,7 +52,7 @@ QMapRouteObjectPrivateQSG::QMapRouteObjectPrivateQSG(QGeoMapObject *q)
QMapRouteObjectPrivateQSG::QMapRouteObjectPrivateQSG(const QMapRouteObjectPrivate &other)
: QMapRouteObjectPrivate(other)
{
- QScopedPointer<QMapPolylineObjectPrivateQSG> poly(new QMapPolylineObjectPrivateQSG(other.q));
+ std::unique_ptr<QMapPolylineObjectPrivateQSG> poly(new QMapPolylineObjectPrivateQSG(other.q));
m_polyline.swap(poly);
m_polyline->m_componentCompleted = true;
setRoute(other.declarativeGeoRoute());
@@ -80,7 +80,7 @@ QSGNode *QMapRouteObjectPrivateQSG::updateMapObjectNode(QSGNode *oldNode,
void QMapRouteObjectPrivateQSG::setRoute(const QDeclarativeGeoRoute *route)
{
const QList<QGeoCoordinate> &path = route->route().path();
- m_polyline->setColor(QColor("deepskyblue")); // ToDo: support MapParameters for this
+ m_polyline->setColor(QColor::fromString("deepskyblue")); // ToDo: support MapParameters for this
m_polyline->setWidth(4);
m_polyline->setPath(path); // SGNodeChanged emitted by m_polyline
}
diff --git a/src/location/labs/qsg/qmaprouteobjectqsg_p_p.h b/src/location/labs/qsg/qmaprouteobjectqsg_p_p.h
index 65ecef28..25e0c352 100644
--- a/src/location/labs/qsg/qmaprouteobjectqsg_p_p.h
+++ b/src/location/labs/qsg/qmaprouteobjectqsg_p_p.h
@@ -86,7 +86,7 @@ public:
virtual QGeoShape geoShape() const override;
// Data Members
- QScopedPointer<QMapPolylineObjectPrivateQSG> m_polyline;
+ std::unique_ptr<QMapPolylineObjectPrivateQSG> m_polyline;
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp
index 4fea05c8..1a401b53 100644
--- a/src/location/maps/qgeocameratiles.cpp
+++ b/src/location/maps/qgeocameratiles.cpp
@@ -271,13 +271,13 @@ Frustum QGeoCameraTilesPrivate::createFrustum(double viewExpansion) const
// The rotation direction here is the opposite of QGeoTiledMapScene::setupCamera,
// as this is basically rotating the map against a fixed view frustum.
mBearing.rotate(1.0 * m_camera.bearing(), toVector3D(view));
- up = toDoubleVector3D(mBearing * toVector3D(up));
+ up = toDoubleVector3D(mBearing.map(toVector3D(up)));
// same for tilting
QDoubleVector3D side2 = QDoubleVector3D::normal(up, view);
QMatrix4x4 mTilt;
mTilt.rotate(-1.0 * m_camera.tilt(), toVector3D(side2));
- eye = toDoubleVector3D((mTilt * toVector3D(view)) + toVector3D(center));
+ eye = toDoubleVector3D((mTilt.map(toVector3D(view))) + toVector3D(center));
view = eye - center;
side = QDoubleVector3D::normal(view, QDoubleVector3D(0.0, 1.0, 0.0));
diff --git a/src/location/maps/qgeocameratiles_p.h b/src/location/maps/qgeocameratiles_p.h
index 7094efdd..3f88e1c9 100644
--- a/src/location/maps/qgeocameratiles_p.h
+++ b/src/location/maps/qgeocameratiles_p.h
@@ -81,7 +81,7 @@ public:
const QSet<QGeoTileSpec>& createTiles();
protected:
- QScopedPointer<QGeoCameraTilesPrivate> d_ptr;
+ std::unique_ptr<QGeoCameraTilesPrivate> d_ptr;
friend class QGeoCameraTilesPrivate;
Q_DISABLE_COPY(QGeoCameraTiles)
diff --git a/src/location/maps/qgeocameratiles_p_p.h b/src/location/maps/qgeocameratiles_p_p.h
index 2f3962af..348f0b7a 100644
--- a/src/location/maps/qgeocameratiles_p_p.h
+++ b/src/location/maps/qgeocameratiles_p_p.h
@@ -119,7 +119,7 @@ public:
QSet<QGeoTileSpec> tilesFromPolygon(const PolygonVector &polygon) const;
static QGeoCameraTilesPrivate *get(QGeoCameraTiles *o) {
- return o->d_ptr.data();
+ return o->d_ptr.get();
}
public:
diff --git a/src/location/maps/qgeoroute.cpp b/src/location/maps/qgeoroute.cpp
index 96f7c883..42c34b39 100644
--- a/src/location/maps/qgeoroute.cpp
+++ b/src/location/maps/qgeoroute.cpp
@@ -653,7 +653,7 @@ int QGeoRoutePrivateDefault::segmentsCount() const
QGeoRouteSegment segment = m_firstSegment;
while (segment.isValid()) {
++count;
- if (segment.isLegLastSegment() && m_containingRoute.data()) // if containing route, this is a leg
+ if (segment.isLegLastSegment() && m_containingRoute) // if containing route, this is a leg
break;
segment = segment.nextRouteSegment();
}
@@ -694,8 +694,7 @@ int QGeoRoutePrivateDefault::legIndex() const
void QGeoRoutePrivateDefault::setContainingRoute(const QGeoRoute &route)
{
- QScopedPointer<QGeoRoute> containingRoute(new QGeoRoute(route));
- m_containingRoute.swap(containingRoute);
+ m_containingRoute.reset(new QGeoRoute(route));
}
QGeoRoute QGeoRoutePrivateDefault::containingRoute() const
diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h
index 04de491d..7fb3f39d 100644
--- a/src/location/maps/qgeoroute_p.h
+++ b/src/location/maps/qgeoroute_p.h
@@ -184,7 +184,7 @@ public:
QList<QGeoRouteLeg> m_legs;
QGeoRouteSegment m_firstSegment;
mutable int m_numSegments;
- QScopedPointer<QGeoRoute> m_containingRoute;
+ std::unique_ptr<QGeoRoute> m_containingRoute;
QVariantMap m_extendedAttributes;
int m_legIndex = 0;
};
diff --git a/src/location/maps/qgeorouteparserosrmv5.cpp b/src/location/maps/qgeorouteparserosrmv5.cpp
index 9f959a4f..895b541d 100644
--- a/src/location/maps/qgeorouteparserosrmv5.cpp
+++ b/src/location/maps/qgeorouteparserosrmv5.cpp
@@ -922,7 +922,7 @@ QGeoRouteReply::Error QGeoRouteParserOsrmV5Private::parseReply(QList<QGeoRoute>
}
QJsonArray osrmRoutes = object.value(QLatin1String("routes")).toArray();
- for (const QJsonValue &r : osrmRoutes) {
+ for (const QJsonValueRef r : osrmRoutes) {
if (!r.isObject())
continue;
QJsonObject routeObject = r.toObject();
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index 6eb6005d..b1582026 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -287,7 +287,7 @@ Flags QGeoServiceProviderPrivate::features(const char *enumName)
if (this->metaData.contains(QStringLiteral("Features"))
&& this->metaData.value(QStringLiteral("Features")).isArray()) {
QCborArray features = this->metaData.value(QStringLiteral("Features")).toArray();
- for (const QCborValue &v : features) {
+ for (const QCborValueRef v : features) {
int val = en.keyToValue(v.toString().toLatin1().constData());
if (v.isString() && val != -1) {
ret |= typename Flags::enum_type(val);
diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp
index 72c32cb8..e7c02ece 100644
--- a/src/location/maps/qgeotiledmapscene.cpp
+++ b/src/location/maps/qgeotiledmapscene.cpp
@@ -456,17 +456,17 @@ void QGeoTiledMapScenePrivate::setupCamera()
static bool qgeotiledmapscene_isTileInViewport_Straight(const QRectF &tileRect, const QMatrix4x4 &matrix)
{
- const QRectF boundingRect = QRectF(matrix * tileRect.topLeft(), matrix * tileRect.bottomRight());
+ const QRectF boundingRect = QRectF(matrix.map(tileRect.topLeft()), matrix.map(tileRect.bottomRight()));
return QRectF(-1, -1, 2, 2).intersects(boundingRect);
}
static bool qgeotiledmapscene_isTileInViewport_rotationTilt(const QRectF &tileRect, const QMatrix4x4 &matrix)
{
// Transformed corners
- const QPointF tlt = matrix * tileRect.topLeft();
- const QPointF trt = matrix * tileRect.topRight();
- const QPointF blt = matrix * tileRect.bottomLeft();
- const QPointF brt = matrix * tileRect.bottomRight();
+ const QPointF tlt = matrix.map(tileRect.topLeft());
+ const QPointF trt = matrix.map(tileRect.topRight());
+ const QPointF blt = matrix.map(tileRect.bottomLeft());
+ const QPointF brt = matrix.map(tileRect.bottomRight());
const QRectF boundingRect = QRectF(QPointF(qMin(qMin(qMin(tlt.x(), trt.x()), blt.x()), brt.x())
,qMax(qMax(qMax(tlt.y(), trt.y()), blt.y()), brt.y()))
diff --git a/src/location/maps/qgeotilerequestmanager_p.h b/src/location/maps/qgeotilerequestmanager_p.h
index b75c3eb1..a7c53d8b 100644
--- a/src/location/maps/qgeotilerequestmanager_p.h
+++ b/src/location/maps/qgeotilerequestmanager_p.h
@@ -75,7 +75,7 @@ public:
QSharedPointer<QGeoTileTexture> tileTexture(const QGeoTileSpec &spec);
private:
- QScopedPointer<QGeoTileRequestManagerPrivate> d_ptr;
+ std::unique_ptr<QGeoTileRequestManagerPrivate> d_ptr;
Q_DISABLE_COPY(QGeoTileRequestManager)
};
diff --git a/src/location/maps/qnavigationmanagerengine_p.h b/src/location/maps/qnavigationmanagerengine_p.h
index e8fc6f18..ed25ae28 100644
--- a/src/location/maps/qnavigationmanagerengine_p.h
+++ b/src/location/maps/qnavigationmanagerengine_p.h
@@ -128,7 +128,7 @@ signals:
void alternativeRoutesChanged();
private:
- QScopedPointer<QAbstractNavigatorPrivate> d;
+ std::unique_ptr<QAbstractNavigatorPrivate> d;
};
class Q_LOCATION_PRIVATE_EXPORT QNavigationManagerEngine : public QObject
@@ -161,7 +161,7 @@ protected:
*/
virtual void engineInitialized();
- QScopedPointer<QNavigationManagerEnginePrivate> d;
+ std::unique_ptr<QNavigationManagerEnginePrivate> d;
};
QT_END_NAMESPACE
diff --git a/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp b/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp
index 3f6e3114..a9bbd35c 100644
--- a/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp
+++ b/src/plugins/geoservices/esri/georoutejsonparser_esri.cpp
@@ -125,7 +125,7 @@ QString GeoRouteJsonParserEsri::errorString() const
void GeoRouteJsonParserEsri::parseDirections()
{
QJsonArray directions = m_json.value(kDirectionsKey).toArray();
- for (const QJsonValue &direction : directions)
+ for (const QJsonValueRef direction : directions)
parseDirection(direction.toObject());
}
@@ -215,7 +215,7 @@ void GeoRouteJsonParserEsri::parseRoutes()
{
QJsonObject routes = m_json.value(kRoutesKey).toObject();
QJsonArray features = routes.value(kRoutesFeaturesKey).toArray();
- for (const QJsonValue &feature : features)
+ for (const QJsonValueRef feature : features)
parseRoute(feature.toObject());
}
@@ -230,7 +230,7 @@ void GeoRouteJsonParserEsri::parseRoute(const QJsonObject &route)
if (!paths.isEmpty())
{
QList<QGeoCoordinate> geoCoordinates;
- for (const QJsonValue &value : paths.first().toArray()) // only first polyline?
+ for (const QJsonValueRef value : paths.first().toArray()) // only first polyline?
{
QJsonArray geoCoordinate = value.toArray();
if (geoCoordinate.size() == 2) // ignore 3rd coordinate
diff --git a/src/plugins/geoservices/esri/placemanagerengine_esri.cpp b/src/plugins/geoservices/esri/placemanagerengine_esri.cpp
index 3a6a267b..4152a268 100644
--- a/src/plugins/geoservices/esri/placemanagerengine_esri.cpp
+++ b/src/plugins/geoservices/esri/placemanagerengine_esri.cpp
@@ -188,7 +188,7 @@ QPlaceReply *PlaceManagerEngineEsri::initializeCategories()
void PlaceManagerEngineEsri::parseCategories(const QJsonArray &jsonArray, const QString &parentCategoryId)
{
- for (const QJsonValue &jsonValue : jsonArray)
+ for (const QJsonValueConstRef jsonValue : jsonArray)
{
if (!jsonValue.isObject())
continue;
@@ -288,7 +288,7 @@ QString PlaceManagerEngineEsri::localizedName(const QJsonObject &jsonObject)
void PlaceManagerEngineEsri::parseCandidateFields(const QJsonArray &jsonArray)
{
- for (const QJsonValue &jsonValue : jsonArray)
+ for (const QJsonValueConstRef jsonValue : jsonArray)
{
if (!jsonValue.isObject())
continue;
@@ -304,7 +304,7 @@ void PlaceManagerEngineEsri::parseCandidateFields(const QJsonArray &jsonArray)
void PlaceManagerEngineEsri::parseCountries(const QJsonArray &jsonArray)
{
- for (const QJsonValue &jsonValue : jsonArray)
+ for (const QJsonValueConstRef jsonValue : jsonArray)
{
if (!jsonValue.isObject())
continue;
diff --git a/src/plugins/geoservices/mapbox/qgeocodereplymapbox.cpp b/src/plugins/geoservices/mapbox/qgeocodereplymapbox.cpp
index aabe82a4..84d9c0e0 100644
--- a/src/plugins/geoservices/mapbox/qgeocodereplymapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeocodereplymapbox.cpp
@@ -86,7 +86,7 @@ void QGeoCodeReplyMapbox::onNetworkReplyFinished()
}
const QJsonArray features = document.object().value(QStringLiteral("features")).toArray();
- for (const QJsonValue &value : features)
+ for (const QJsonValueConstRef value : features)
locations.append(QMapboxCommon::parseGeoLocation(value.toObject()));
setLocations(locations);
diff --git a/src/plugins/geoservices/mapbox/qgeoroutingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeoroutingmanagerenginemapbox.cpp
index 08a3b5a6..78753a80 100644
--- a/src/plugins/geoservices/mapbox/qgeoroutingmanagerenginemapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeoroutingmanagerenginemapbox.cpp
@@ -104,7 +104,7 @@ static QVariantMap parseMapboxVoiceInstruction(const QJsonObject &voiceInstructi
static QVariantList parseMapboxVoiceInstructions(const QJsonArray &voiceInstructions)
{
QVariantList list;
- for (const QJsonValue &voiceInstructionValue : voiceInstructions) {
+ for (const QJsonValueConstRef voiceInstructionValue : voiceInstructions) {
if (voiceInstructionValue.isObject())
list << parseMapboxVoiceInstruction(voiceInstructionValue.toObject());
}
@@ -133,7 +133,7 @@ static QVariantMap parseMapboxBannerComponent(const QJsonObject &bannerComponent
static QVariantList parseMapboxBannerComponents(const QJsonArray &bannerComponents)
{
QVariantList list;
- for (const QJsonValue &bannerComponentValue : bannerComponents) {
+ for (const QJsonValueConstRef bannerComponentValue : bannerComponents) {
if (bannerComponentValue.isObject())
list << parseMapboxBannerComponent(bannerComponentValue.toObject());
}
@@ -187,7 +187,7 @@ static QVariantMap parseMapboxBannerInstruction(const QJsonObject &bannerInstruc
static QVariantList parseMapboxBannerInstructions(const QJsonArray &bannerInstructions)
{
QVariantList list;
- for (const QJsonValue &bannerInstructionValue : bannerInstructions) {
+ for (const QJsonValueConstRef bannerInstructionValue : bannerInstructions) {
if (bannerInstructionValue.isObject())
list << parseMapboxBannerInstruction(bannerInstructionValue.toObject());
}
diff --git a/src/plugins/geoservices/mapbox/qmapboxcommon.cpp b/src/plugins/geoservices/mapbox/qmapboxcommon.cpp
index 7946102e..59cbc713 100644
--- a/src/plugins/geoservices/mapbox/qmapboxcommon.cpp
+++ b/src/plugins/geoservices/mapbox/qmapboxcommon.cpp
@@ -67,7 +67,7 @@ QGeoLocation QMapboxCommon::parseGeoLocation(const QJsonObject &response)
// 'address'. The former provides the street name, and the latter provides
// the street number in that case.
if (response.value(QStringLiteral("place_type")).isArray()) {
- for (const QJsonValue &value : response.value(QStringLiteral("place_type")).toArray()) {
+ for (const QJsonValueConstRef value : response.value(QStringLiteral("place_type")).toArray()) {
if (!value.isString())
continue;
if (value.toString() == QStringLiteral("address")) {
@@ -89,7 +89,7 @@ QGeoLocation QMapboxCommon::parseGeoLocation(const QJsonObject &response)
address.setStreet(streetAddress);
if (response.value(QStringLiteral("context")).isArray()) {
- for (const QJsonValue &value : response.value(QStringLiteral("context")).toArray()) {
+ for (const QJsonValueConstRef value : response.value(QStringLiteral("context")).toArray()) {
if (!value.isObject())
continue;
diff --git a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp
index 574ce44b..4d75f728 100644
--- a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp
@@ -182,7 +182,7 @@ void QPlaceSearchReplyMapbox::onReplyFinished()
const QList<QPlaceCategory> categories = request().categories();
QList<QPlaceSearchResult> results;
- for (const QJsonValue &feature : features) {
+ for (const QJsonValue feature : features) {
QPlaceResult placeResult = parsePlaceResult(feature.toObject(), attribution);
if (!categories.isEmpty()) {
diff --git a/src/plugins/geoservices/mapbox/qplacesearchsuggestionreplymapbox.cpp b/src/plugins/geoservices/mapbox/qplacesearchsuggestionreplymapbox.cpp
index b8fc315f..a1c56272 100644
--- a/src/plugins/geoservices/mapbox/qplacesearchsuggestionreplymapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qplacesearchsuggestionreplymapbox.cpp
@@ -97,7 +97,7 @@ void QPlaceSearchSuggestionReplyMapbox::onReplyFinished()
const QJsonArray features = document.object().value(QStringLiteral("features")).toArray();
QStringList suggestions;
- for (const QJsonValue &feature : features) {
+ for (const QJsonValueConstRef feature : features) {
if (feature.isObject())
suggestions.append(feature.toObject().value(QStringLiteral("text")).toString());
}
diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.h b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.h
index 293ebb7f..02fae833 100644
--- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.h
+++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.h
@@ -62,8 +62,8 @@ public:
void render(QQuickWindow *);
private:
- QScopedPointer<QMapboxGL> m_map;
- QScopedPointer<QOpenGLFramebufferObject> m_fbo;
+ std::unique_ptr<QMapboxGL> m_map;
+ std::unique_ptr<QOpenGLFramebufferObject> m_fbo;
};
class QSGMapboxGLRenderNode : public QSGRenderNode
@@ -78,7 +78,7 @@ public:
StateFlags changedStates() const override;
private:
- QScopedPointer<QMapboxGL> m_map;
+ std::unique_ptr<QMapboxGL> m_map;
};
#endif // QSGMAPBOXGLNODE_H
diff --git a/src/plugins/geoservices/nokia/qgeocodejsonparser.cpp b/src/plugins/geoservices/nokia/qgeocodejsonparser.cpp
index e0ebf923..cc8725c4 100644
--- a/src/plugins/geoservices/nokia/qgeocodejsonparser.cpp
+++ b/src/plugins/geoservices/nokia/qgeocodejsonparser.cpp
@@ -274,8 +274,8 @@ bool checkDocument(const QJsonDocument &doc, QString *errorString)
return false;
}
- QJsonArray view = rit.value().toArray();
- for (const QJsonValue &viewElement : view) {
+ const QJsonArray view = rit.value().toArray();
+ for (const QJsonValueConstRef viewElement : view) {
if (!viewElement.isObject()) {
*errorString = QLatin1String("Expected View array element to be object");
return false;
@@ -291,8 +291,8 @@ bool checkDocument(const QJsonDocument &doc, QString *errorString)
return false;
}
- QJsonArray result = voit.value().toArray();
- for (const QJsonValue &resultElement : result) {
+ const QJsonArray result = voit.value().toArray();
+ for (const QJsonValueConstRef resultElement : result) {
if (!resultElement.isObject()) {
*errorString = QLatin1String("Expected Result array element to be object");
return false;
@@ -342,8 +342,8 @@ bool parseLocation(const QJsonObject &obj, const QGeoShape &bounds, QGeoLocation
if (!label.isEmpty()) {
address.setText(label);
}
- QJsonArray additionalData = addr.value("AdditionalData").toArray();
- for (const QJsonValue &adv : additionalData) {
+ const QJsonArray additionalData = addr.value("AdditionalData").toArray();
+ for (const QJsonValueConstRef adv : additionalData) {
if (adv.isObject()) {
const QJsonObject &ado(adv.toObject());
if (ado.value("key").toString() == QLatin1String("CountryName")) {
@@ -369,9 +369,9 @@ bool parseLocation(const QJsonObject &obj, const QGeoShape &bounds, QGeoLocation
void parseDocument(const QJsonDocument &doc, const QGeoShape &bounds, QList<QGeoLocation> *locs)
{
QJsonArray view = doc.object().value("Response").toObject().value("View").toArray();
- for (const QJsonValue &viewElement : view) {
+ for (const QJsonValueRef viewElement : view) {
QJsonArray result = viewElement.toObject().value("Result").toArray();
- for (const QJsonValue &resultElement : result) {
+ for (const QJsonValueRef resultElement : result) {
QGeoLocation location;
if (parseLocation(resultElement.toObject().value("Location").toObject(), bounds, &location)) {
locs->append(location);
diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
index a0e261b8..d3bbbefb 100644
--- a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
+++ b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
@@ -267,11 +267,11 @@ void QGeoTileProviderOsm::addProvider(TileProvider *provider)
{
if (!provider)
return;
- QScopedPointer<TileProvider> p(provider);
+ std::unique_ptr<TileProvider> p(provider);
if (provider->status() == TileProvider::Invalid)
return; // if the provider is already resolved and invalid, no point in adding it.
- provider = p.take();
+ provider = p.release();
provider->setNetworkManager(m_nm);
provider->setParent(this);
m_providerList.append(provider);
diff --git a/tests/auto/geotestplugin/qgeotilefetcher_test.h b/tests/auto/geotestplugin/qgeotilefetcher_test.h
index 2782ea64..4c2eb4fd 100644
--- a/tests/auto/geotestplugin/qgeotilefetcher_test.h
+++ b/tests/auto/geotestplugin/qgeotilefetcher_test.h
@@ -81,7 +81,7 @@ public:
TiledMapReplyTest* mappingReply = new TiledMapReplyTest(spec, this);
QImage im(256, 256, QImage::Format_RGB888);
- im.fill(QColor("lightgray"));
+ im.fill(QColor::fromString("lightgray"));
QRectF rect;
QString text("X: " + QString::number(spec.x()) + "\nY: " + QString::number(spec.y()) + "\nZ: " + QString::number(spec.zoom()));
rect.setWidth(250);
@@ -89,14 +89,14 @@ public:
rect.setLeft(3);
rect.setTop(3);
QPainter painter;
- QPen pen(QColor("firebrick"));
+ QPen pen(QColor::fromString("firebrick"));
painter.begin(&im);
painter.setPen(pen);
painter.setFont( QFont("Times", 35, 10, false));
painter.drawText(rect, text);
// different border color for vertically and horizontally adjacent frames
if ((spec.x() + spec.y()) % 2 == 0)
- pen.setColor(QColor("yellow"));
+ pen.setColor(QColor::fromString("yellow"));
pen.setWidth(5);
painter.setPen(pen);
painter.drawRect(0,0,255,255);
diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
index c7189278..9c5f8f00 100644
--- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
+++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp
@@ -70,8 +70,8 @@ private Q_SLOTS:
void fetchTiles_data();
private:
- QScopedPointer<QGeoTiledMapTest> m_map;
- QScopedPointer<FetchTileCounter> m_tilesCounter;
+ std::unique_ptr<QGeoTiledMapTest> m_map;
+ std::unique_ptr<FetchTileCounter> m_tilesCounter;
QGeoTileFetcherTest *m_fetcher;
};
@@ -111,7 +111,7 @@ void tst_QGeoTiledMap::initTestCase()
m_map->setActiveMapType(m_map->m_engine->supportedMapTypes().first());
m_fetcher = static_cast<QGeoTileFetcherTest*>(m_map->m_engine->tileFetcher());
m_tilesCounter.reset(new FetchTileCounter());
- connect(m_fetcher, SIGNAL(tileFetched(const QGeoTileSpec&)), m_tilesCounter.data(), SLOT(tileFetched(const QGeoTileSpec&)));
+ connect(m_fetcher, SIGNAL(tileFetched(const QGeoTileSpec&)), m_tilesCounter.get(), SLOT(tileFetched(const QGeoTileSpec&)));
}
void tst_QGeoTiledMap::fetchTiles()
diff --git a/tests/auto/qmlinterface/tst_qmlinterface.cpp b/tests/auto/qmlinterface/tst_qmlinterface.cpp
index 683b35d8..f7bcee8d 100644
--- a/tests/auto/qmlinterface/tst_qmlinterface.cpp
+++ b/tests/auto/qmlinterface/tst_qmlinterface.cpp
@@ -339,7 +339,7 @@ void tst_qmlinterface::testPlace()
QVERIFY(qmlObject->property("name").toString().isEmpty());
QVERIFY(qmlObject->property("placeId").toString().isEmpty());
QVERIFY(qmlObject->property("attribution").toString().isEmpty());
- QQmlListReference categories(qmlObject, "categories", &engine);
+ QQmlListReference categories(qmlObject, "categories");
QCOMPARE(categories.count(), 0);
QCOMPARE(qmlObject->property("location").value<QGeoLocation>(), QGeoLocation());
QCOMPARE(qmlObject->property("ratings").value<QPlaceRatings>(), QPlaceRatings());