summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-19 03:03:44 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-19 03:03:44 +0100
commit435f478a3e80d9ed17691c85e584d7fc6a71c3b7 (patch)
tree56e6dc7fcbcd76d568a2bcc919c81fcb88fb1cdb /src/location/declarativemaps
parent1129934e9648e6f770272b7c3bbcd88380d424e2 (diff)
parentfe04f2bc8deabcd8fdf5b8c408b23bc3ce071e6d (diff)
downloadqtlocation-435f478a3e80d9ed17691c85e584d7fc6a71c3b7.tar.gz
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I2d19d8340a70760e8d545582fd7c966263e958bd
Diffstat (limited to 'src/location/declarativemaps')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index c3a87495..6a2d82e8 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -374,7 +374,10 @@ void QDeclarativeGeoMap::initialize()
connect(m_map.data(), &QGeoMap::cameraDataChanged,
this, &QDeclarativeGeoMap::onCameraDataChanged);
- m_map->setCameraData(cameraData);
+ m_map->setCameraData(cameraData); // This normally triggers property changed signals.
+ // BUT not in this case, since m_cameraData is already == cameraData.
+ // So, emit visibleRegionChanged() separately, as
+ // the effective visible region becomes available only now.
for (auto obj : qAsConst(m_pendingMapObjects))
obj->setMap(m_map);
@@ -386,6 +389,7 @@ void QDeclarativeGeoMap::initialize()
connect(m_map.data(), &QGeoMap::visibleAreaChanged, this, &QDeclarativeGeoMap::visibleAreaChanged);
emit mapReadyChanged(true);
+ emit visibleRegionChanged();
if (m_copyrights) // To not update during initialize()
update();
@@ -894,7 +898,8 @@ void QDeclarativeGeoMap::setZoomLevel(qreal zoomLevel, bool overzoom)
m_cameraData.setZoomLevel(zoomLevel);
if (zlHasChanged) {
emit zoomLevelChanged(zoomLevel);
- emit visibleRegionChanged();
+ // do not emit visibleRegionChanged() here, because, if the map isn't initialized,
+ // the getter won't return anything updated
}
}
}
@@ -980,7 +985,8 @@ void QDeclarativeGeoMap::setBearing(qreal bearing)
m_cameraData.setBearing(bearing);
if (bearingHasChanged) {
emit bearingChanged(bearing);
- emit visibleRegionChanged();
+ // do not emit visibleRegionChanged() here, because, if the map isn't initialized,
+ // the getter won't return anything updated
}
}
}
@@ -1047,7 +1053,8 @@ void QDeclarativeGeoMap::setTilt(qreal tilt)
m_cameraData.setTilt(tilt);
if (tiltHasChanged) {
emit tiltChanged(tilt);
- emit visibleRegionChanged();
+ // do not emit visibleRegionChanged() here, because, if the map isn't initialized,
+ // the getter won't return anything updated
}
}
}
@@ -1107,7 +1114,8 @@ void QDeclarativeGeoMap::setFieldOfView(qreal fieldOfView)
m_cameraData.setFieldOfView(fieldOfView);
if (fovChanged) {
emit fieldOfViewChanged(fieldOfView);
- emit visibleRegionChanged();
+ // do not emit visibleRegionChanged() here, because, if the map isn't initialized,
+ // the getter won't return anything updated
}
}
}
@@ -1276,7 +1284,8 @@ void QDeclarativeGeoMap::setCenter(const QGeoCoordinate &center)
m_cameraData.setCenter(center);
if (centerHasChanged) {
emit centerChanged(center);
- emit visibleRegionChanged();
+ // do not emit visibleRegionChanged() here, because, if the map isn't initialized,
+ // the getter won't return anything updated
}
}
}