From 1688c44d223145abfdca19a7b31faecbafb0d315 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Sun, 6 Jan 2019 11:36:08 +0100 Subject: 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 --- src/location/declarativemaps/qdeclarativegeomapitemview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/location/declarativemaps/qdeclarativegeomapitemview.cpp') 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 -- cgit v1.2.1