From ef471a0254c7c3a5978d06980f1e7e32229f21b4 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Thu, 26 May 2016 13:11:43 +0200 Subject: Polish and update map elements on window resize When the a map element gets resized, the center stays the same, meaning that map estate gets added (or removed) on each side of the element in equal amount. This means that the old screen coordinates of a map element change, and therefore it must be repolished and updated. Task-number: QTBUG-53128 Change-Id: Id26b111e8e33075082fa599e6eac92cb8089f5e4 Reviewed-by: Alex Blasche --- src/imports/location/qdeclarativegeomapitembase.cpp | 2 ++ src/imports/location/qdeclarativegeomapquickitem.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/imports') diff --git a/src/imports/location/qdeclarativegeomapitembase.cpp b/src/imports/location/qdeclarativegeomapitembase.cpp index cde00abf..3cd29ce3 100644 --- a/src/imports/location/qdeclarativegeomapitembase.cpp +++ b/src/imports/location/qdeclarativegeomapitembase.cpp @@ -133,6 +133,8 @@ void QDeclarativeGeoMapItemBase::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *m if (map_ && quickMap_) { connect(map_, SIGNAL(cameraDataChanged(QGeoCameraData)), this, SLOT(baseCameraDataChanged(QGeoCameraData))); + connect(quickMap, SIGNAL(heightChanged()), this, SLOT(polishAndUpdate())); + connect(quickMap, SIGNAL(widthChanged()), this, SLOT(polishAndUpdate())); lastSize_ = QSizeF(quickMap_->width(), quickMap_->height()); lastCameraData_ = map_->cameraData(); } diff --git a/src/imports/location/qdeclarativegeomapquickitem.cpp b/src/imports/location/qdeclarativegeomapquickitem.cpp index ca67b183..a66efb1d 100644 --- a/src/imports/location/qdeclarativegeomapquickitem.cpp +++ b/src/imports/location/qdeclarativegeomapquickitem.cpp @@ -157,8 +157,6 @@ void QDeclarativeGeoMapQuickItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap * { QDeclarativeGeoMapItemBase::setMap(quickMap,map); if (map && quickMap) { - connect(quickMap, SIGNAL(heightChanged()), this, SLOT(polishAndUpdate())); - connect(quickMap, SIGNAL(widthChanged()), this, SLOT(polishAndUpdate())); connect(map, SIGNAL(cameraDataChanged(QGeoCameraData)), this, SLOT(polishAndUpdate())); polishAndUpdate(); -- cgit v1.2.1