diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-14 22:23:28 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-20 13:42:22 +0200 |
commit | 08e84794be1dbdd8a616a298dd607f7c570de6a9 (patch) | |
tree | b38c01cd0dce7280ada4cf86e5d7805b3d481ffa | |
parent | efda8ab8f1fa9ef2c5502579e8e8c25e1ef4dc10 (diff) |
Cleanup: use member initialization for QGeoTiledMapScenePrivate
Remove unused member m_mapEdgeSize (only set, but never read).
Change-Id: I2442ba3fd4fa3f1ebff26ea0a6d604d700f6896c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 4017f0ad8ccbade2121f24da3d82794272d56ade)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/location/maps/qgeotiledmapscene.cpp | 18 | ||||
-rw-r--r-- | src/location/maps/qgeotiledmapscene_p_p.h | 28 |
2 files changed, 17 insertions, 29 deletions
diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp index 3193d01a..853e46f1 100644 --- a/src/location/maps/qgeotiledmapscene.cpp +++ b/src/location/maps/qgeotiledmapscene.cpp @@ -84,7 +84,6 @@ void QGeoTiledMapScene::updateSceneParameters() const float delta = d->m_cameraData.zoomLevel() - d->m_intZoomLevel; d->m_linearScaling = qAbs(delta) > 0.05 || d->isTiltedOrRotated(); d->m_sideLength = 1 << d->m_intZoomLevel; - d->m_mapEdgeSize = std::pow(2.0, d->m_cameraData.zoomLevel()) * d->m_tileSize; } void QGeoTiledMapScene::setTileSize(int tileSize) @@ -149,22 +148,7 @@ void QGeoTiledMapScene::clearTexturedTiles() } QGeoTiledMapScenePrivate::QGeoTiledMapScenePrivate() - : QObjectPrivate(), - m_tileSize(0), -#ifdef QT_LOCATION_DEBUG - m_scaleFactor(1.0), -#else - m_scaleFactor(10.0), -#endif - m_intZoomLevel(0), - m_sideLength(0), - m_minTileX(-1), - m_minTileY(-1), - m_maxTileX(-1), - m_maxTileY(-1), - m_tileXWrapsBelow(0), - m_linearScaling(false), - m_dropTextures(false) + : QObjectPrivate() { } diff --git a/src/location/maps/qgeotiledmapscene_p_p.h b/src/location/maps/qgeotiledmapscene_p_p.h index 2610e30a..4a794751 100644 --- a/src/location/maps/qgeotiledmapscene_p_p.h +++ b/src/location/maps/qgeotiledmapscene_p_p.h @@ -150,7 +150,7 @@ public: public: QSize m_screenSize; // in pixels - int m_tileSize; // the pixel resolution for each tile + int m_tileSize = 0; // the pixel resolution for each tile QGeoCameraData m_cameraData; QRectF m_visibleArea; QSet<QGeoTileSpec> m_visibleTiles; @@ -162,28 +162,32 @@ public: // scales up the tile geometry and the camera altitude, resulting in no visible effect // other than to control the accuracy of the render by keeping the values in a sensible range - double m_scaleFactor; + double m_scaleFactor = +#ifdef QT_LOCATION_DEBUG + 1.0; +#else + 10.0; +#endif // rounded down, positive zoom is zooming in, corresponding to reduced altitude - int m_intZoomLevel; + int m_intZoomLevel = 0; // mercatorToGrid transform // the number of tiles in each direction for the whole map (earth) at the current zoom level. // it is 1<<zoomLevel - int m_sideLength; - double m_mapEdgeSize; + int m_sideLength = 0; QHash<QGeoTileSpec, QSharedPointer<QGeoTileTexture> > m_textures; QList<QGeoTileSpec> m_updatedTextures; // tilesToGrid transform - int m_minTileX; // the minimum tile index, i.e. 0 to sideLength which is 1<< zoomLevel - int m_minTileY; - int m_maxTileX; - int m_maxTileY; - int m_tileXWrapsBelow; // the wrap point as a tile index - bool m_linearScaling; - bool m_dropTextures; + int m_minTileX = -1; // the minimum tile index, i.e. 0 to sideLength which is 1<< zoomLevel + int m_minTileY = -1; + int m_maxTileX = -1; + int m_maxTileY = -1; + int m_tileXWrapsBelow = 0; // the wrap point as a tile index + bool m_linearScaling = false; + bool m_dropTextures = false; #ifdef QT_LOCATION_DEBUG double m_sideLengthPixel; |