summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-02-09 18:47:33 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-02-21 12:33:42 +0000
commitd87f58c8d8eab0c66a9b0e2d0355ff42fbf33b93 (patch)
tree1d6a59690c51791eda6c789e7227e088aece758a
parent9daf00ef519e3dbd061e64bfe13b2ca9bfab4e28 (diff)
downloadqtlocation-d87f58c8d8eab0c66a9b0e2d0355ff42fbf33b93.tar.gz
Add virtual QGeoMap::removeMapObject
this can be called in ~QGeoMapObjectPrivate overrides to delete themselves from the map. Change-Id: I715491728a60b3d1bd60944a51dfa0ba07a3b29e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/location/maps/qgeomap.cpp7
-rw-r--r--src/location/maps/qgeomap_p.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp
index 58657143..5f125169 100644
--- a/src/location/maps/qgeomap.cpp
+++ b/src/location/maps/qgeomap.cpp
@@ -290,6 +290,13 @@ bool QGeoMap::createMapObjectImplementation(QGeoMapObject *obj)
return false;
}
+/*!
+ To be called in ~QGeoMapObjectPrivate overrides, if needed
+*/
+void QGeoMap::removeMapObject(QGeoMapObject * /*obj*/)
+{
+}
+
QList<QGeoMapObject *> QGeoMap::mapObjects() const
{
Q_D(const QGeoMap);
diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h
index 8e4a8839..e67340be 100644
--- a/src/location/maps/qgeomap_p.h
+++ b/src/location/maps/qgeomap_p.h
@@ -157,6 +157,7 @@ protected:
void setCameraData(const QGeoCameraData &cameraData);
void setCameraCapabilities(const QGeoCameraCapabilities &cameraCapabilities);
virtual QSGNode *updateSceneGraph(QSGNode *node, QQuickWindow *window) = 0;
+ virtual void removeMapObject(QGeoMapObject *obj);
Q_SIGNALS:
void cameraDataChanged(const QGeoCameraData &cameraData);
@@ -170,6 +171,7 @@ Q_SIGNALS:
private:
Q_DISABLE_COPY(QGeoMap)
friend class QDeclarativeGeoMap; //updateSceneGraph
+ friend class QGeoMapPrivate;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoMap::ItemTypes)