summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index ad1dc1f3..7cc7a0fa 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -450,7 +450,7 @@ QQuickGeoMapGestureArea *QDeclarativeGeoMap::gesture()
*/
void QDeclarativeGeoMap::populateMap()
{
- QSet<QObject *> kids = children().toSet();
+ QSet<QObject *> kids(children().cbegin(), children().cend());
const QList<QQuickItem *> quickKids = childItems();
for (QQuickItem *ite: quickKids)
kids.insert(ite);
@@ -892,8 +892,10 @@ void QDeclarativeGeoMap::setZoomLevel(qreal zoomLevel, bool overzoom)
} else {
const bool zlHasChanged = zoomLevel != m_cameraData.zoomLevel();
m_cameraData.setZoomLevel(zoomLevel);
- if (zlHasChanged)
+ if (zlHasChanged) {
emit zoomLevelChanged(zoomLevel);
+ emit visibleRegionChanged();
+ }
}
}
@@ -976,8 +978,10 @@ void QDeclarativeGeoMap::setBearing(qreal bearing)
} else {
const bool bearingHasChanged = bearing != m_cameraData.bearing();
m_cameraData.setBearing(bearing);
- if (bearingHasChanged)
+ if (bearingHasChanged) {
emit bearingChanged(bearing);
+ emit visibleRegionChanged();
+ }
}
}
@@ -1041,8 +1045,10 @@ void QDeclarativeGeoMap::setTilt(qreal tilt)
} else {
const bool tiltHasChanged = tilt != m_cameraData.tilt();
m_cameraData.setTilt(tilt);
- if (tiltHasChanged)
+ if (tiltHasChanged) {
emit tiltChanged(tilt);
+ emit visibleRegionChanged();
+ }
}
}
@@ -1099,8 +1105,10 @@ void QDeclarativeGeoMap::setFieldOfView(qreal fieldOfView)
} else {
const bool fovChanged = fieldOfView != m_cameraData.fieldOfView();
m_cameraData.setFieldOfView(fieldOfView);
- if (fovChanged)
+ if (fovChanged) {
emit fieldOfViewChanged(fieldOfView);
+ emit visibleRegionChanged();
+ }
}
}
@@ -1266,8 +1274,10 @@ void QDeclarativeGeoMap::setCenter(const QGeoCoordinate &center)
} else {
const bool centerHasChanged = center != m_cameraData.center();
m_cameraData.setCenter(center);
- if (centerHasChanged)
+ if (centerHasChanged) {
emit centerChanged(center);
+ emit visibleRegionChanged();
+ }
}
}
@@ -1293,7 +1303,7 @@ QGeoCoordinate QDeclarativeGeoMap::center() const
\l zoomLevel of the map. Any previously set value to those
properties will be overridden.
- This property does not provide any change notifications.
+ \note Since Qt 5.14 This property provides change notifications.
\since 5.6
*/
@@ -1309,15 +1319,18 @@ void QDeclarativeGeoMap::setVisibleRegion(const QGeoShape &shape)
// shape invalidated -> nothing to fit anymore
m_visibleRegion = QGeoRectangle();
m_pendingFitViewport = false;
+ emit visibleRegionChanged();
return;
}
if (!m_map || !width() || !height()) {
m_pendingFitViewport = true;
+ emit visibleRegionChanged();
return;
}
fitViewportToGeoShape(m_visibleRegion);
+ emit visibleRegionChanged();
}
QGeoShape QDeclarativeGeoMap::visibleRegion() const
@@ -1768,6 +1781,9 @@ void QDeclarativeGeoMap::onCameraDataChanged(const QGeoCameraData &cameraData)
emit tiltChanged(m_cameraData.tilt());
if (fovHasChanged)
emit fieldOfViewChanged(m_cameraData.fieldOfView());
+ if (centerHasChanged || zoomHasChanged || bearingHasChanged
+ || tiltHasChanged || fovHasChanged)
+ emit visibleRegionChanged();
}
/*!