summaryrefslogtreecommitdiff
path: root/src/location
diff options
context:
space:
mode:
Diffstat (limited to 'src/location')
-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
31 files changed, 63 insertions, 65 deletions
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