summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:54 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:54 +0100
commitfe04f2bc8deabcd8fdf5b8c408b23bc3ce071e6d (patch)
tree5efbefa5d0ffee681cac8d86a93f26fb20d3827c /src/location/declarativemaps/qdeclarativegeomap.cpp
parent741d90b31650d71d7ea7a7cc9e83b1ab36e060c5 (diff)
parent664a83674b2bf8313763870c9eca7c4c558a14bc (diff)
downloadqtlocation-fe04f2bc8deabcd8fdf5b8c408b23bc3ce071e6d.tar.gz
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ifa572a6e1c0835e0ca6d5bf85cde1db854604cf6
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-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
}
}
}