diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-08-20 17:56:41 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-08-21 12:31:33 +0000 |
commit | ecef017a48f6fc291af3d4e79ddd5829f0386f1b (patch) | |
tree | 29bdbe4722af2002833d1159bf7533908d4d61a5 /src | |
parent | 480b5e168da11dc917dfd7ed8d44359d702eac83 (diff) | |
download | qtlocation-ecef017a48f6fc291af3d4e79ddd5829f0386f1b.tar.gz |
Fix missing emits pre-map-initialization
This patch fixes a regression introduced with
367c49e91366aa9b13bc7d64209321168680841e, that doesn't make the Map
emit property changed signals before it is initialized for camera data
properties.
Change-Id: I14ea0a08780d7b2ed79c72f37bc340a1780a0d78
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomap.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 7d1bcea9..b0adc54c 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -878,7 +878,10 @@ void QDeclarativeGeoMap::setZoomLevel(qreal zoomLevel, bool overzoom) cameraData.setCenter(coord); m_map->setCameraData(cameraData); } else { + const bool zlHasChanged = zoomLevel != m_cameraData.zoomLevel(); m_cameraData.setZoomLevel(zoomLevel); + if (zlHasChanged) + emit zoomLevelChanged(zoomLevel); } } @@ -959,7 +962,10 @@ void QDeclarativeGeoMap::setBearing(qreal bearing) cameraData.setBearing(bearing); m_map->setCameraData(cameraData); } else { + const bool bearingHasChanged = bearing != m_cameraData.bearing(); m_cameraData.setBearing(bearing); + if (bearingHasChanged) + emit bearingChanged(bearing); } } @@ -1021,7 +1027,10 @@ void QDeclarativeGeoMap::setTilt(qreal tilt) cameraData.setTilt(tilt); m_map->setCameraData(cameraData); } else { + const bool tiltHasChanged = tilt != m_cameraData.tilt(); m_cameraData.setTilt(tilt); + if (tiltHasChanged) + emit tiltChanged(tilt); } } @@ -1076,7 +1085,10 @@ void QDeclarativeGeoMap::setFieldOfView(qreal fieldOfView) cameraData.setFieldOfView(fieldOfView); m_map->setCameraData(cameraData); } else { + const bool fovChanged = fieldOfView != m_cameraData.fieldOfView(); m_cameraData.setFieldOfView(fieldOfView); + if (fovChanged) + emit fieldOfViewChanged(fieldOfView); } } @@ -1240,7 +1252,10 @@ void QDeclarativeGeoMap::setCenter(const QGeoCoordinate ¢er) cameraData.setCenter(coord); m_map->setCameraData(cameraData); } else { + const bool centerHasChanged = center != m_cameraData.center(); m_cameraData.setCenter(center); + if (centerHasChanged) + emit centerChanged(center); } } |