From ffee803f1099f85082a152791a7a3b261947a751 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 24 Jun 2020 11:57:21 +0200 Subject: Use QList instead of QVector Task-number: QTBUG-84469 Change-Id: Iefd2fb627602ef4744d80858eee72a089ef5f4ec Reviewed-by: Lars Knoll --- .../declarativemaps/qdeclarativegeomap.cpp | 2 +- .../declarativemaps/qdeclarativegeomapitemview.cpp | 2 +- .../declarativemaps/qdeclarativepolygonmapitem.cpp | 8 +-- .../qdeclarativepolygonmapitem_p_p.h | 13 ++-- .../qdeclarativepolylinemapitem.cpp | 83 ++++++++++------------ .../qdeclarativepolylinemapitem_p_p.h | 35 ++++----- .../declarativemaps/qgeomapitemgeometry.cpp | 4 +- .../declarativemaps/qgeomapitemgeometry_p.h | 10 +-- .../declarativemaps/qquickgeomapgesturearea_p.h | 4 +- src/location/labs/qmapobjectview.cpp | 2 +- src/location/labs/qmapobjectview_p.h | 10 +-- src/location/labs/qmapobjectview_p_p.h | 2 +- src/location/maps/qgeocameratiles.cpp | 14 ++-- src/location/maps/qgeocameratiles_p_p.h | 4 +- src/location/maps/qgeotiledmapscene.cpp | 2 +- src/location/maps/qgeotiledmapscene_p_p.h | 2 +- src/location/places/qplacemanager.h | 2 +- .../mapbox/qgeotiledmappingmanagerenginemapbox.cpp | 2 +- .../geoservices/mapbox/qgeotilefetchermapbox.cpp | 2 +- .../geoservices/mapbox/qgeotilefetchermapbox.h | 6 +- .../geoservices/osm/qgeofiletilecacheosm.cpp | 10 +-- src/plugins/geoservices/osm/qgeofiletilecacheosm.h | 11 ++- .../osm/qgeotiledmappingmanagerengineosm.cpp | 16 ++--- .../osm/qgeotiledmappingmanagerengineosm.h | 6 +- src/plugins/geoservices/osm/qgeotilefetcherosm.cpp | 15 ++-- src/plugins/geoservices/osm/qgeotilefetcherosm.h | 7 +- .../geoservices/osm/qgeotileproviderosm.cpp | 11 +-- src/plugins/geoservices/osm/qgeotileproviderosm.h | 9 ++- src/plugins/position/serialnmea/qiopipe.cpp | 2 +- src/plugins/position/serialnmea/qiopipe_p.h | 2 +- src/positioning/qgeopath.cpp | 4 +- src/positioning/qgeopath_p.h | 24 +++---- src/positioning/qgeopolygon.cpp | 2 +- src/positioning/qgeopolygon_p.h | 2 +- 34 files changed, 157 insertions(+), 173 deletions(-) diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index e68961e5..fe59e246 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -2672,7 +2672,7 @@ bool QDeclarativeGeoMap::sendTouchEvent(QTouchEvent *event) grabber = touchPointGrabberItem(point); if (grabber && stealEvent && !grabber->keepTouchGrab() && grabber != this) { - QVector ids; + QList ids; foreach (const QTouchEvent::TouchPoint &tp, event->touchPoints()) { if (!(tp.state() & Qt::TouchPointReleased)) { ids.append(tp.id()); diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp index 43e24620..f9e7a938 100644 --- a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp @@ -185,7 +185,7 @@ void QDeclarativeGeoMapItemView::modelUpdated(const QQmlChangeSet &changeSet, bo removeInstantiatedItems(); } else { // Remove items from the back to the front to retain the mapping to what is received from the changesets - const QVector &removes = changeSet.removes(); + const QList &removes = changeSet.removes(); std::map mapRemoves; for (int i = 0; i < removes.size(); i++) mapRemoves.insert(std::pair(removes.at(i).start(), i)); diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp index fa6ee174..24086993 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp @@ -398,8 +398,8 @@ static void wrapPath(const QGeoPolygon &poly } static void cutPathEars(const QList> &wrappedPaths, - QVector &screenVertices, - QVector &screenIndices) + QList &screenVertices, + QList &screenIndices) { using Coord = double; using N = uint32_t; @@ -427,8 +427,8 @@ static void cutPathEars(const QList> &wrappedPaths, } static void cutPathEars(const QList &wrappedPath, - QVector &screenVertices, - QVector &screenIndices) + QList &screenVertices, + QList &screenIndices) { using Coord = double; using N = uint32_t; diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h index 8d566e69..12bd4b86 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p_p.h @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -117,9 +117,8 @@ public: void allocateAndFillPolygon(QSGGeometry *geom) const { - - const QVector &vx = m_screenVertices; - const QVector &ix = m_screenIndices; + const QList &vx = m_screenVertices; + const QList &ix = m_screenIndices; geom->allocate(vx.size(), ix.size()); if (geom->indexType() == QSGGeometry::UnsignedShortType) { @@ -137,10 +136,10 @@ public: pts[i].set(vx[i].x, vx[i].y); } - QVector m_screenVertices; - QVector m_screenIndices; + QList m_screenVertices; + QList m_screenIndices; QDoubleVector2D m_bboxLeftBoundWrapped; - QVector m_wrappedPolygons; + QList m_wrappedPolygons; int m_wrapOffset; }; diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp index d59704dc..0448d667 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp @@ -571,10 +571,8 @@ static inline int clipPointType(qreal x, qreal y, const QRectF &rect) return type; } -static void clipSegmentToRect(qreal x0, qreal y0, qreal x1, qreal y1, - const QRectF &clipRect, - QVector &outPoints, - QVector &outTypes) +static void clipSegmentToRect(qreal x0, qreal y0, qreal x1, qreal y1, const QRectF &clipRect, + QList &outPoints, QList &outTypes) { int type0 = clipPointType(x0, y0, clipRect); int type1 = clipPointType(x1, y1, clipRect); @@ -637,11 +635,9 @@ static void clipSegmentToRect(qreal x0, qreal y0, qreal x1, qreal y1, } } -static void clipPathToRect(const QVector &points, - const QVector &types, - const QRectF &clipRect, - QVector &outPoints, - QVector &outTypes) +static void clipPathToRect(const QList &points, + const QList &types, const QRectF &clipRect, + QList &outPoints, QList &outTypes) { outPoints.clear(); outPoints.reserve(points.size()); @@ -686,8 +682,8 @@ void QGeoMapPolylineGeometry::updateScreenPoints(const QGeoMap &map, viewport.adjust(-strokeWidth, -strokeWidth, strokeWidth * 2, strokeWidth * 2); viewport.translate(-1 * origin); - QVector points; - QVector types; + QList points; + QList types; if (clipToViewport_) { // Although the geometry has already been clipped against the visible region in wrapped mercator space. @@ -755,7 +751,7 @@ bool QGeoMapPolylineGeometry::contains(const QPointF &point) const { // screenOutline_.contains(screenPoint) doesn't work, as, it appears, that // screenOutline_ for QGeoMapPolylineGeometry is empty (QRectF(0,0 0x0)) - const QVector &verts = vertices(); + const QList &verts = vertices(); QPolygonF tri; for (int i = 0; i < verts.size(); ++i) { tri << verts[i]; @@ -1625,7 +1621,7 @@ bool QGeoMapPolylineGeometryOpenGL::allocateAndFillEntries(QSGGeometry *geom, return false; } - const QVector &v = *m_screenVertices; + const QList &v = *m_screenVertices; if (v.size() < 2) { geom->allocate(0, 0); return true; @@ -1692,7 +1688,7 @@ void QGeoMapPolylineGeometryOpenGL::allocateAndFillLineStrip(QSGGeometry *geom, // Select LOD. Generate if not present. Assign it to m_screenVertices; Q_UNUSED(lod) - const QVector &vx = *m_screenVertices; + const QList &vx = *m_screenVertices; geom->allocate(vx.size()); QSGGeometry::Point2D *pts = geom->vertexDataAsPoint2D(); @@ -1918,10 +1914,10 @@ const char *MapPolylineShaderExtruded::vertexShaderMiteredSegments() const "}\n"; } -QVector QGeoMapItemLODGeometry::getSimplified( - QVector &wrappedPath, // reference as it gets copied in the nested call - double leftBoundWrapped, - unsigned int zoom) +QList QGeoMapItemLODGeometry::getSimplified( + QList + &wrappedPath, // reference as it gets copied in the nested call + double leftBoundWrapped, unsigned int zoom) { // Try a simplify step QList data; @@ -1932,7 +1928,7 @@ QVector QGeoMapItemLODGeometry::getSimplified zoom); data.clear(); - QVector simple; + QList simple; for (auto e: simplified) simple << e; return simple; @@ -1947,16 +1943,11 @@ bool QGeoMapItemLODGeometry::isLODActive(unsigned int lod) const class PolylineSimplifyTask : public QRunnable { public: - PolylineSimplifyTask(const QSharedPointer > &input, // reference as it gets copied in the nested call - const QSharedPointer > &output, - double leftBound, - unsigned int zoom, - QSharedPointer &working) - : m_zoom(zoom) - , m_leftBound(leftBound) - , m_input(input) - , m_output(output) - , m_working(working) + PolylineSimplifyTask(const QSharedPointer> + &input, // reference as it gets copied in the nested call + const QSharedPointer> &output, + double leftBound, unsigned int zoom, QSharedPointer &working) + : m_zoom(zoom), m_leftBound(leftBound), m_input(input), m_output(output), m_working(working) { Q_ASSERT(!input.isNull()); Q_ASSERT(!output.isNull()); @@ -1969,25 +1960,23 @@ public: // Skip sending notifications for now. Updated data will be picked up eventually. // ToDo: figure out how to connect a signal from here to a slot in the item. *m_working = QGeoMapPolylineGeometryOpenGL::zoomToLOD(m_zoom); - const QVector res = - QGeoMapPolylineGeometryOpenGL::getSimplified( *m_input, - m_leftBound, - QGeoMapPolylineGeometryOpenGL::zoomForLOD(m_zoom)); + const QList res = + QGeoMapPolylineGeometryOpenGL::getSimplified( + *m_input, m_leftBound, QGeoMapPolylineGeometryOpenGL::zoomForLOD(m_zoom)); *m_output = res; *m_working = 0; } unsigned int m_zoom; double m_leftBound; - QSharedPointer > m_input, m_output; + QSharedPointer> m_input, m_output; QSharedPointer m_working; }; -void QGeoMapItemLODGeometry::enqueueSimplificationTask(const QSharedPointer > &input, - const QSharedPointer > &output, - double leftBound, - unsigned int zoom, - QSharedPointer &working) +void QGeoMapItemLODGeometry::enqueueSimplificationTask( + const QSharedPointer> &input, + const QSharedPointer> &output, double leftBound, + unsigned int zoom, QSharedPointer &working) { Q_ASSERT(!input.isNull()); Q_ASSERT(!output.isNull()); @@ -2010,8 +1999,8 @@ void QGeoMapItemLODGeometry::selectLOD(unsigned int zoom, double leftBound, bool // if here, zoomToLOD != 0 and no current working task. // So select the last filled LOD != m_working (lower-bounded by 1, // guaranteed to exist), and enqueue the right one - m_verticesLOD[requestedLod] = QSharedPointer>( - new QVector); + m_verticesLOD[requestedLod] = QSharedPointer>( + new QList); for (unsigned int i = requestedLod - 1; i >= 1; i--) { if (*m_working != i && !m_verticesLOD[i].isNull()) { @@ -2019,8 +2008,8 @@ void QGeoMapItemLODGeometry::selectLOD(unsigned int zoom, double leftBound, bool break; } else if (i == 1) { // get 1 synchronously if not computed already - m_verticesLOD[1] = QSharedPointer>( - new QVector); + m_verticesLOD[1] = QSharedPointer>( + new QList); *m_verticesLOD[1] = getSimplified( *m_verticesLOD[0], leftBound, zoomForLOD(0)); @@ -2044,16 +2033,16 @@ void QGeoMapItemLODGeometry::selectLODOnDataChanged(unsigned int zoom, double le if (lod > 0) { // Generate ZL 1 as fallback for all cases != 0. Do not do if 0 is requested // (= old behavior, LOD disabled) - m_verticesLOD[1] = QSharedPointer>( - new QVector); + m_verticesLOD[1] = QSharedPointer>( + new QList); *m_verticesLOD[1] = getSimplified( *m_verticesLOD[0], leftBound, zoomForLOD(0)); } if (lod > 1) { if (!m_verticesLOD[lod]) - m_verticesLOD[lod] = QSharedPointer>( - new QVector); + m_verticesLOD[lod] = QSharedPointer>( + new QList); enqueueSimplificationTask( m_verticesLOD.at(0), m_verticesLOD[lod], leftBound, diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h b/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h index 2a588222..2cec8830 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h @@ -93,8 +93,8 @@ public: const QDoubleVector2D &leftBoundWrapped); public: - QVector srcPoints_; - QVector srcPointTypes_; + QList srcPoints_; + QList srcPointTypes_; #ifdef QT_LOCATION_DEBUG QList m_wrappedPath; @@ -216,9 +216,11 @@ protected: class Q_LOCATION_PRIVATE_EXPORT QGeoMapItemLODGeometry { public: - mutable std::array>, 7> m_verticesLOD; // fix it to 7, - // do not allow simplifications beyond ZL 20. This could actually be limited even further - mutable QVector *m_screenVertices; + mutable std::array>, 7> + m_verticesLOD; // fix it to 7, + // do not allow simplifications beyond ZL 20. This could actually be + // limited even further + mutable QList *m_screenVertices; mutable QSharedPointer m_working; QGeoMapItemLODGeometry() @@ -229,8 +231,8 @@ public: void resetLOD() { // New pointer, some old LOD task might still be running and operating on the old pointers. - m_verticesLOD[0] = QSharedPointer>( - new QVector); + m_verticesLOD[0] = QSharedPointer>( + new QList); for (unsigned int i = 1; i < m_verticesLOD.size(); ++i) m_verticesLOD[i] = nullptr; // allocate on first use m_screenVertices = m_verticesLOD.front().data(); // resetting pointer to data to be LOD 0 @@ -244,16 +246,15 @@ public: void selectLOD(unsigned int zoom, double leftBound, bool /*closed*/); - static QVector getSimplified ( - QVector &wrappedPath, - double leftBoundWrapped, - unsigned int zoom); + static QList + getSimplified(QList &wrappedPath, double leftBoundWrapped, + unsigned int zoom); - static void enqueueSimplificationTask(const QSharedPointer > &input, // reference as it gets copied in the nested call - const QSharedPointer > &output, - double leftBound, - unsigned int zoom, - QSharedPointer &working); + static void enqueueSimplificationTask( + const QSharedPointer> + &input, // reference as it gets copied in the nested call + const QSharedPointer> &output, + double leftBound, unsigned int zoom, QSharedPointer &working); void selectLODOnDataChanged(unsigned int zoom, double leftBound) const; @@ -365,7 +366,7 @@ public: public: QDoubleVector2D m_bboxLeftBoundWrapped; - QVector m_wrappedPolygons; + QList m_wrappedPolygons; int m_wrapOffset; friend class QDeclarativeCircleMapItem; diff --git a/src/location/declarativemaps/qgeomapitemgeometry.cpp b/src/location/declarativemaps/qgeomapitemgeometry.cpp index 28e9fa67..f7feec5c 100644 --- a/src/location/declarativemaps/qgeomapitemgeometry.cpp +++ b/src/location/declarativemaps/qgeomapitemgeometry.cpp @@ -71,8 +71,8 @@ void QGeoMapItemGeometry::translate(const QPointF &offset) */ void QGeoMapItemGeometry::allocateAndFill(QSGGeometry *geom) const { - const QVector &vx = screenVertices_; - const QVector &ix = screenIndices_; + const QList &vx = screenVertices_; + const QList &ix = screenIndices_; if (isIndexed()) { geom->allocate(vx.size(), ix.size()); diff --git a/src/location/declarativemaps/qgeomapitemgeometry_p.h b/src/location/declarativemaps/qgeomapitemgeometry_p.h index aa5ea4ac..d233978c 100644 --- a/src/location/declarativemaps/qgeomapitemgeometry_p.h +++ b/src/location/declarativemaps/qgeomapitemgeometry_p.h @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include @@ -106,8 +106,8 @@ public: return QVector2D(screenVertices_[index]); } - inline QVector vertices() const { return screenVertices_; } - inline QVector indices() const { return screenIndices_; } + inline QList vertices() const { return screenVertices_; } + inline QList indices() const { return screenIndices_; } inline bool isIndexed() const { return (!screenIndices_.isEmpty()); } @@ -153,8 +153,8 @@ protected: QGeoCoordinate srcOrigin_; - QVector screenVertices_; - QVector screenIndices_; + QList screenVertices_; + QList screenIndices_; }; QT_END_NAMESPACE diff --git a/src/location/declarativemaps/qquickgeomapgesturearea_p.h b/src/location/declarativemaps/qquickgeomapgesturearea_p.h index 0bc774d3..dfbe682d 100644 --- a/src/location/declarativemaps/qquickgeomapgesturearea_p.h +++ b/src/location/declarativemaps/qquickgeomapgesturearea_p.h @@ -331,8 +331,8 @@ private: QVector2D m_flickVector; QElapsedTimer m_lastPosTime; QPointF m_lastPos; - QVector m_allPoints; - QVector m_touchPoints; + QList m_allPoints; + QList m_touchPoints; QScopedPointer m_mousePoint; QPointF m_sceneStartPoint1; diff --git a/src/location/labs/qmapobjectview.cpp b/src/location/labs/qmapobjectview.cpp index 54d384fb..e0a6a294 100644 --- a/src/location/labs/qmapobjectview.cpp +++ b/src/location/labs/qmapobjectview.cpp @@ -322,7 +322,7 @@ void QMapObjectView::modelUpdated(const QQmlChangeSet &changeSet, bool reset) flushDelegateModel(); } else { // Remove map objects from the back to the front to retain the mapping to what is received from the changesets - const QVector &removes = changeSet.removes(); + const QList &removes = changeSet.removes(); std::map mapRemoves; for (int i = 0; i < removes.size(); i++) mapRemoves.insert(std::pair(removes.at(i).start(), i)); diff --git a/src/location/labs/qmapobjectview_p.h b/src/location/labs/qmapobjectview_p.h index be5801d3..46b5a378 100644 --- a/src/location/labs/qmapobjectview_p.h +++ b/src/location/labs/qmapobjectview_p.h @@ -51,7 +51,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -104,9 +104,11 @@ protected: void flushUserAddedMapObjects(); QQmlDelegateModel *m_delegateModel = nullptr; - QVector> m_instantiatedMapObjects; - QVector> m_pendingMapObjects; // for items instantiated before the map is set - QVector> m_userAddedMapObjects; // A third list containing the objects dynamically added through addMapObject + QList> m_instantiatedMapObjects; + QList> + m_pendingMapObjects; // for items instantiated before the map is set + QList> m_userAddedMapObjects; // A third list containing the objects + // dynamically added through addMapObject bool m_creatingObject = false; }; diff --git a/src/location/labs/qmapobjectview_p_p.h b/src/location/labs/qmapobjectview_p_p.h index 55f45f67..8c368231 100644 --- a/src/location/labs/qmapobjectview_p_p.h +++ b/src/location/labs/qmapobjectview_p_p.h @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp index 3a2732b2..4b0b2b51 100644 --- a/src/location/maps/qgeocameratiles.cpp +++ b/src/location/maps/qgeocameratiles.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include @@ -346,10 +346,8 @@ Frustum QGeoCameraTilesPrivate::createFrustum(double viewExpansion) const return frustum; } -static bool appendZIntersects(const QDoubleVector3D &start, - const QDoubleVector3D &end, - double z, - QVector &results) +static bool appendZIntersects(const QDoubleVector3D &start, const QDoubleVector3D &end, double z, + QList &results) { if (start.z() == end.z()) { return false; @@ -400,7 +398,7 @@ QPair QGeoCameraTilesPrivate::splitPolygonAtAxisVa return QPair(polygonBelow, polygonAbove); } - QVector comparisons = QVector(polygon.size()); + QList comparisons = QList(polygon.size()); for (int i = 0; i < size; ++i) { double v = polygon.at(i).get(axis); @@ -664,8 +662,8 @@ QSet QGeoCameraTilesPrivate::tilesFromPolygon(const PolygonVector if (numPoints == 0) return QSet(); - QVector tilesX(polygon.size()); - QVector tilesY(polygon.size()); + QList tilesX(polygon.size()); + QList tilesY(polygon.size()); // grab tiles at the corners of the polygon for (int i = 0; i < numPoints; ++i) { diff --git a/src/location/maps/qgeocameratiles_p_p.h b/src/location/maps/qgeocameratiles_p_p.h index 846d95f2..17e0036d 100644 --- a/src/location/maps/qgeocameratiles_p_p.h +++ b/src/location/maps/qgeocameratiles_p_p.h @@ -55,7 +55,7 @@ #include "qgeocameradata_p.h" #include "qgeotilespec_p.h" -#include +#include #include QT_BEGIN_NAMESPACE @@ -73,7 +73,7 @@ struct Q_LOCATION_PRIVATE_EXPORT Frustum QDoubleVector3D bottomRightFar; }; -typedef QVector PolygonVector; +typedef QList PolygonVector; class Q_LOCATION_PRIVATE_EXPORT QGeoCameraTilesPrivate { diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp index 18d92b00..f345e555 100644 --- a/src/location/maps/qgeotiledmapscene.cpp +++ b/src/location/maps/qgeotiledmapscene.cpp @@ -625,7 +625,7 @@ QSGNode *QGeoTiledMapScene::updateSceneGraph(QSGNode *oldNode, QQuickWindow *win // Evicting loZL tiles temporarily used in place of hiZL ones if (d->m_updatedTextures.size()) { - const QVector &toRemove = d->m_updatedTextures; + const QList &toRemove = d->m_updatedTextures; for (const QGeoTileSpec &s : toRemove) { if (mapRoot->tiles->tiles.contains(s)) delete mapRoot->tiles->tiles.take(s); diff --git a/src/location/maps/qgeotiledmapscene_p_p.h b/src/location/maps/qgeotiledmapscene_p_p.h index 5d98abd5..44827884 100644 --- a/src/location/maps/qgeotiledmapscene_p_p.h +++ b/src/location/maps/qgeotiledmapscene_p_p.h @@ -171,7 +171,7 @@ public: double m_mapEdgeSize; QHash > m_textures; - QVector m_updatedTextures; + QList m_updatedTextures; // tilesToGrid transform int m_minTileX; // the minimum tile index, i.e. 0 to sideLength which is 1<< zoomLevel diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h index 146bdd02..a31cc6bf 100644 --- a/src/location/places/qplacemanager.h +++ b/src/location/places/qplacemanager.h @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp index 53f650e3..f89bb7ef 100644 --- a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp @@ -119,7 +119,7 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q } } - QVector mapIds; + QList mapIds; for (int i=0; i < mapTypes.size(); ++i) mapIds.push_back(mapTypes[i].name()); diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp index 0b128556..9fe0da8c 100644 --- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp @@ -60,7 +60,7 @@ void QGeoTileFetcherMapbox::setUserAgent(const QByteArray &userAgent) m_userAgent = userAgent; } -void QGeoTileFetcherMapbox::setMapIds(const QVector &mapIds) +void QGeoTileFetcherMapbox::setMapIds(const QList &mapIds) { m_mapIds = mapIds; } diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h index 47f3a8aa..6a653354 100644 --- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h +++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h @@ -37,7 +37,7 @@ #ifndef QGEOTILEFETCHERMAPBOX_H #define QGEOTILEFETCHERMAPBOX_H -#include +#include #include QT_BEGIN_NAMESPACE @@ -53,7 +53,7 @@ public: QGeoTileFetcherMapbox(int scaleFactor, QGeoTiledMappingManagerEngine *parent); void setUserAgent(const QByteArray &userAgent); - void setMapIds(const QVector &mapIds); + void setMapIds(const QList &mapIds); void setFormat(const QString &format); void setAccessToken(const QString &accessToken); @@ -65,7 +65,7 @@ private: QString m_format; QString m_replyFormat; QString m_accessToken; - QVector m_mapIds; + QList m_mapIds; int m_scaleFactor; }; diff --git a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp index 3bb1ea7b..3ca0255c 100644 --- a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp +++ b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp @@ -45,11 +45,13 @@ QT_BEGIN_NAMESPACE -QGeoFileTileCacheOsm::QGeoFileTileCacheOsm(const QVector &providers, +QGeoFileTileCacheOsm::QGeoFileTileCacheOsm(const QList &providers, const QString &offlineDirectory, - const QString &directory, - QObject *parent) -: QGeoFileTileCache(directory, parent), m_offlineDirectory(offlineDirectory), m_offlineData(false), m_providers(providers) + const QString &directory, QObject *parent) + : QGeoFileTileCache(directory, parent), + m_offlineDirectory(offlineDirectory), + m_offlineData(false), + m_providers(providers) { m_highDpi.resize(providers.size()); if (!offlineDirectory.isEmpty()) { diff --git a/src/plugins/geoservices/osm/qgeofiletilecacheosm.h b/src/plugins/geoservices/osm/qgeofiletilecacheosm.h index da1fd0d3..a7a203c8 100644 --- a/src/plugins/geoservices/osm/qgeofiletilecacheosm.h +++ b/src/plugins/geoservices/osm/qgeofiletilecacheosm.h @@ -49,10 +49,9 @@ class QGeoFileTileCacheOsm : public QGeoFileTileCache { Q_OBJECT public: - QGeoFileTileCacheOsm(const QVector &providers, + QGeoFileTileCacheOsm(const QList &providers, const QString &offlineDirectory = QString(), - const QString &directory = QString(), - QObject *parent = 0); + const QString &directory = QString(), QObject *parent = 0); ~QGeoFileTileCacheOsm(); QSharedPointer get(const QGeoTileSpec &spec) override; @@ -77,9 +76,9 @@ protected: QDir m_offlineDirectory; bool m_offlineData; - QVector m_providers; - QVector m_highDpi; - QVector m_maxMapIdTimestamps; + QList m_providers; + QList m_highDpi; + QList m_maxMapIdTimestamps; }; QT_END_NAMESPACE diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp index 22c32342..b9b3f476 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp @@ -105,13 +105,13 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian } /* TileProviders setup */ - QVector providers_street; - QVector providers_satellite; - QVector providers_cycle; - QVector providers_transit; - QVector providers_nighttransit; - QVector providers_terrain; - QVector providers_hiking; + QList providers_street; + QList providers_satellite; + QList providers_cycle; + QList providers_transit; + QList providers_nighttransit; + QList providers_terrain; + QList providers_hiking; if (highdpi) { providers_street.push_back(new TileProvider(domain + "street-hires", true)); providers_satellite.push_back(new TileProvider(domain + "satellite-hires", true)); @@ -349,7 +349,7 @@ QGeoMap *QGeoTiledMappingManagerEngineOsm::createMap() return map; } -const QVector &QGeoTiledMappingManagerEngineOsm::providers() +const QList &QGeoTiledMappingManagerEngineOsm::providers() { return m_providers; } diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h index 12290c8f..adf4b161 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -60,7 +60,7 @@ public: ~QGeoTiledMappingManagerEngineOsm(); QGeoMap *createMap() override; - const QVector &providers(); + const QList &providers(); QString customCopyright() const; protected Q_SLOTS: @@ -71,7 +71,7 @@ protected: void updateMapTypes(); private: - QVector m_providers; + QList m_providers; QString m_customCopyright; QString m_cacheDirectory; QString m_offlineDirectory; diff --git a/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp b/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp index 135654a9..49c41bcb 100644 --- a/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp +++ b/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE -static bool providersResolved(const QVector &providers) +static bool providersResolved(const QList &providers) { foreach (const QGeoTileProviderOsm *provider, providers) if (!provider->isResolved()) @@ -75,12 +75,13 @@ QGeoTileFetcherOsmPrivate::~QGeoTileFetcherOsmPrivate() { } - -QGeoTileFetcherOsm::QGeoTileFetcherOsm(const QVector &providers, - QNetworkAccessManager *nm, - QGeoMappingManagerEngine *parent) -: QGeoTileFetcher(*new QGeoTileFetcherOsmPrivate(), parent), m_userAgent("Qt Location based application"), - m_providers(providers), m_nm(nm), m_ready(true) +QGeoTileFetcherOsm::QGeoTileFetcherOsm(const QList &providers, + QNetworkAccessManager *nm, QGeoMappingManagerEngine *parent) + : QGeoTileFetcher(*new QGeoTileFetcherOsmPrivate(), parent), + m_userAgent("Qt Location based application"), + m_providers(providers), + m_nm(nm), + m_ready(true) { m_nm->setParent(this); foreach (QGeoTileProviderOsm *provider, m_providers) { diff --git a/src/plugins/geoservices/osm/qgeotilefetcherosm.h b/src/plugins/geoservices/osm/qgeotilefetcherosm.h index 682ff689..3de9d630 100644 --- a/src/plugins/geoservices/osm/qgeotilefetcherosm.h +++ b/src/plugins/geoservices/osm/qgeotilefetcherosm.h @@ -42,7 +42,7 @@ #include "qgeotileproviderosm.h" #include -#include +#include QT_BEGIN_NAMESPACE @@ -57,8 +57,7 @@ class QGeoTileFetcherOsm : public QGeoTileFetcher friend class QGeoMapReplyOsm; friend class QGeoTiledMappingManagerEngineOsm; public: - QGeoTileFetcherOsm(const QVector &providers, - QNetworkAccessManager *nm, + QGeoTileFetcherOsm(const QList &providers, QNetworkAccessManager *nm, QGeoMappingManagerEngine *parent); void setUserAgent(const QByteArray &userAgent); @@ -79,7 +78,7 @@ private: void readyUpdated(); QByteArray m_userAgent; - QVector m_providers; + QList m_providers; QNetworkAccessManager *m_nm; bool m_ready; }; diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp index dfe3d8e9..3f48ff5e 100644 --- a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp +++ b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp @@ -55,11 +55,14 @@ static void setSSL(QGeoMapType &mapType, bool isHTTPS) metadata); } -QGeoTileProviderOsm::QGeoTileProviderOsm(QNetworkAccessManager *nm, - const QGeoMapType &mapType, - const QVector &providers, +QGeoTileProviderOsm::QGeoTileProviderOsm(QNetworkAccessManager *nm, const QGeoMapType &mapType, + const QList &providers, const QGeoCameraCapabilities &cameraCapabilities) -: m_nm(nm), m_provider(nullptr), m_mapType(mapType), m_status(Idle), m_cameraCapabilities(cameraCapabilities) + : m_nm(nm), + m_provider(nullptr), + m_mapType(mapType), + m_status(Idle), + m_cameraCapabilities(cameraCapabilities) { for (int i = 0; i < providers.size(); ++i) { TileProvider *p = providers[i]; diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.h b/src/plugins/geoservices/osm/qgeotileproviderosm.h index ab4e2294..c2eec6f9 100644 --- a/src/plugins/geoservices/osm/qgeotileproviderosm.h +++ b/src/plugins/geoservices/osm/qgeotileproviderosm.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -141,9 +141,8 @@ public: Resolving, Resolved }; - QGeoTileProviderOsm(QNetworkAccessManager *nm, - const QGeoMapType &mapType, - const QVector &providers, + QGeoTileProviderOsm(QNetworkAccessManager *nm, const QGeoMapType &mapType, + const QList &providers, const QGeoCameraCapabilities &cameraCapabilities); ~QGeoTileProviderOsm(); @@ -181,7 +180,7 @@ protected: /* Data members */ QNetworkAccessManager *m_nm; - QVector m_providerList; + QList m_providerList; TileProvider *m_provider; int m_providerId; QGeoMapType m_mapType; diff --git a/src/plugins/position/serialnmea/qiopipe.cpp b/src/plugins/position/serialnmea/qiopipe.cpp index fab0b56b..75cd923c 100644 --- a/src/plugins/position/serialnmea/qiopipe.cpp +++ b/src/plugins/position/serialnmea/qiopipe.cpp @@ -82,7 +82,7 @@ bool QIOPipePrivate::readAvailableData() { void QIOPipePrivate::pumpData(const QByteArray &ba) { if (m_proxying) { - QVector toRemove; + QList toRemove; for (int i = 0; i < childPipes.size(); ++i) { const QPointer &cp = childPipes.at(i); if (!cp) { diff --git a/src/plugins/position/serialnmea/qiopipe_p.h b/src/plugins/position/serialnmea/qiopipe_p.h index 472ab102..66453e10 100644 --- a/src/plugins/position/serialnmea/qiopipe_p.h +++ b/src/plugins/position/serialnmea/qiopipe_p.h @@ -105,7 +105,7 @@ public: bool m_proxying = false; QPointer source; - QVector> childPipes; + QList> childPipes; }; #endif // QIOPIPE_P_H diff --git a/src/positioning/qgeopath.cpp b/src/positioning/qgeopath.cpp index b6513bc7..01e41ab2 100644 --- a/src/positioning/qgeopath.cpp +++ b/src/positioning/qgeopath.cpp @@ -587,7 +587,7 @@ bool QGeoPathPrivate::containsCoordinate(const QGeoCoordinate &coordinate) const void QGeoPathPrivate::translate(double degreesLatitude, double degreesLongitude) { // Need min/maxLati, so update bbox - QVector m_deltaXs; + QList m_deltaXs; double m_minX, m_maxX, m_minLati, m_maxLati; m_bboxDirty = false; computeBBox(m_path, m_deltaXs, m_minX, m_maxX, m_minLati, m_maxLati, m_bbox); @@ -671,7 +671,7 @@ void QGeoPathPrivate::markDirty() void QGeoPathPrivate::computeBoundingBox() { - QVector m_deltaXs; + QList m_deltaXs; double m_minX, m_maxX, m_minLati, m_maxLati; m_bboxDirty = false; computeBBox(m_path, m_deltaXs, m_minX, m_maxX, m_minLati, m_maxLati, m_bbox); diff --git a/src/positioning/qgeopath_p.h b/src/positioning/qgeopath_p.h index 6dd17b09..152b8e40 100644 --- a/src/positioning/qgeopath_p.h +++ b/src/positioning/qgeopath_p.h @@ -56,17 +56,13 @@ #include "qgeocoordinate.h" #include "qlocationutils_p.h" #include -#include +#include QT_BEGIN_NAMESPACE -inline static void computeBBox( const QList &m_path, - QVector &m_deltaXs, - double &m_minX, - double &m_maxX, - double &m_minLati, - double &m_maxLati, - QGeoRectangle &m_bbox) +inline static void computeBBox(const QList &m_path, QList &m_deltaXs, + double &m_minX, double &m_maxX, double &m_minLati, double &m_maxLati, + QGeoRectangle &m_bbox) { if (m_path.isEmpty()) { m_deltaXs.clear(); @@ -116,13 +112,9 @@ inline static void computeBBox( const QList &m_path, QGeoCoordinate(m_minLati, m_path.at(maxId).longitude())); } -inline static void updateBBox( const QList &m_path, - QVector &m_deltaXs, - double &m_minX, - double &m_maxX, - double &m_minLati, - double &m_maxLati, - QGeoRectangle &m_bbox) +inline static void updateBBox(const QList &m_path, QList &m_deltaXs, + double &m_minX, double &m_maxX, double &m_minLati, double &m_maxLati, + QGeoRectangle &m_bbox) { if (m_path.isEmpty()) { m_deltaXs.clear(); @@ -244,7 +236,7 @@ public: void updateBoundingBox(); // data members - QVector m_deltaXs; // longitude deltas from m_path[0] + QList m_deltaXs; // longitude deltas from m_path[0] double m_minX = 0; // minimum value inside deltaXs double m_maxX = 0; // maximum value inside deltaXs double m_minLati = 0; // minimum latitude. paths do not wrap around through the poles diff --git a/src/positioning/qgeopolygon.cpp b/src/positioning/qgeopolygon.cpp index 7d8a0ce0..e44c1f9e 100644 --- a/src/positioning/qgeopolygon.cpp +++ b/src/positioning/qgeopolygon.cpp @@ -553,7 +553,7 @@ inline static void translatePoly( QList &m_path, void QGeoPolygonPrivate::translate(double degreesLatitude, double degreesLongitude) { // Need min/maxLati, so update bbox - QVector m_deltaXs; + QList m_deltaXs; double m_minX, m_maxX, m_minLati, m_maxLati; m_bboxDirty = false; // Updated in translatePoly computeBBox(m_path, m_deltaXs, m_minX, m_maxX, m_minLati, m_maxLati, m_bbox); diff --git a/src/positioning/qgeopolygon_p.h b/src/positioning/qgeopolygon_p.h index 880a2784..7b633496 100644 --- a/src/positioning/qgeopolygon_p.h +++ b/src/positioning/qgeopolygon_p.h @@ -111,7 +111,7 @@ public: void updateBoundingBox(); // data members - QVector m_deltaXs; // longitude deltas from m_path[0] + QList m_deltaXs; // longitude deltas from m_path[0] double m_minX = 0; // minimum value inside deltaXs double m_maxX = 0; // maximum value inside deltaXs double m_minLati = 0; // minimum latitude. paths do not wrap around through the poles -- cgit v1.2.1