summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeomap.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-04-13 16:50:12 +0200
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-05-05 13:03:04 +0000
commit4fb86e6d29a13d61ac04a302e4d312de349115f8 (patch)
tree1d8e2f55a555324b297520c783d973681415c894 /src/location/maps/qgeomap.cpp
parentcbe2583de456f18ddd2e4e5d2da225935aac1475 (diff)
downloadqtlocation-4fb86e6d29a13d61ac04a302e4d312de349115f8.tar.gz
Fixes PIMPL in QGeoTiledMap.
This commit makes following changes: * QGeoTiledMapPrivate is now a subclass of QGeoMapPrivate. * makes QGeoMap constructor private. * change visibility of setCameraData in QGeoMap, so that only QGeoMapController can modify the camera data. * moves mapResized,changeCameraData,changeActiveMapType to private implementation interface. * moves mapVersion member function to base class. Change-Id: I336e7f72b03e845e09e445a6eebad90b2e46dbd1 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/location/maps/qgeomap.cpp')
-rw-r--r--src/location/maps/qgeomap.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp
index 3f0d1510..c1c88a3a 100644
--- a/src/location/maps/qgeomap.cpp
+++ b/src/location/maps/qgeomap.cpp
@@ -42,8 +42,10 @@
QT_BEGIN_NAMESPACE
-QGeoMap::QGeoMap(QGeoMappingManagerEngine *engine, QObject *parent)
- : QObject(*new QGeoMapPrivate(engine),parent) {}
+QGeoMap::QGeoMap(QGeoMapPrivate &dd, QObject *parent)
+ : QObject(dd,parent)
+{
+}
QGeoMap::~QGeoMap()
{
@@ -105,7 +107,7 @@ void QGeoMap::setActiveMapType(const QGeoMapType type)
{
Q_D(QGeoMap);
d->m_activeMapType = type;
- changeActiveMapType(type);
+ d->changeActiveMapType(type);
d->setCameraData(d->m_cameraData);
update();
}
@@ -137,6 +139,11 @@ QGeoMappingManagerEngine *QGeoMap::engine()
return d->m_engine;
}
+int QGeoMap::mapVersion()
+{
+ return -1;
+}
+
QGeoMapPrivate::QGeoMapPrivate(QGeoMappingManagerEngine *engine)
: QObjectPrivate(),
m_width(0),
@@ -159,7 +166,6 @@ QGeoMapPrivate::~QGeoMapPrivate()
void QGeoMapPrivate::setCameraData(const QGeoCameraData &cameraData)
{
- Q_Q(QGeoMap);
QGeoCameraData oldCameraData = m_cameraData;
m_cameraData = cameraData;
@@ -193,16 +199,15 @@ void QGeoMapPrivate::setCameraData(const QGeoCameraData &cameraData)
// this is mainly an optimization to the initialization of the geomap, which would otherwise
// call changeCameraData four or more times
if (m_width > 0)
- q->changeCameraData(oldCameraData);
+ changeCameraData(oldCameraData);
}
void QGeoMapPrivate::resize(int width, int height)
{
- Q_Q(QGeoMap);
m_width = width;
m_height = height;
m_aspectRatio = 1.0 * m_width / m_height;
- q->mapResized(width, height);
+ mapResized(width, height);
setCameraData(m_cameraData);
}