summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2019-01-06 11:36:08 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2019-01-07 11:25:20 +0000
commit1688c44d223145abfdca19a7b31faecbafb0d315 (patch)
tree887eb5d5ac59869f64ef657d579ae3429f731f3a /src/location/declarativemaps/qdeclarativegeomapitemview.cpp
parentb1fe421e9a64d57a6135a95453caf847ab6e6e78 (diff)
downloadqtlocation-1688c44d223145abfdca19a7b31faecbafb0d315.tar.gz
Fix MapItemView attempting to instantiate items with map not set
This case was not a problem when the only incubation mode was Asynchronous, because the test for m_map was done in createdItem. Now that Synchronous is supported too, this check has to be done earlier or else instantiated items will never be added to the map. Change-Id: Ifaa033fb0b64cabe74df395fcb387d162cd02b80 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapitemview.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitemview.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
index 41ab3453..d404fd47 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomapitemview.cpp
@@ -175,6 +175,9 @@ void QDeclarativeGeoMapItemView::createdItem(int index, QObject */*object*/)
void QDeclarativeGeoMapItemView::modelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
+ if (!m_map) // everything will be done in instantiateAllItems. Removal is done by declarativegeomap.
+ return;
+
// move changes are expressed as one remove + one insert, with the same moveId.
// For simplicity, they will be treated as remove + insert.
// Changes will be also ignored, as they represent only data changes, not layout changes