summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomap_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-12-11 15:49:02 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-01-16 10:40:24 +0000
commit17c494dcd248c32891da940ef68b1e6b520175b8 (patch)
treed034eb170d9dd41dde3a129470c76e30280aff01 /src/location/declarativemaps/qdeclarativegeomap_p.h
parent2b6020a59ef503eeadabc532782f5e9e795fcf3f (diff)
downloadqtlocation-17c494dcd248c32891da940ef68b1e6b520175b8.tar.gz
Fix copyright notice performance when adding/removing items
This change avoids rescanning the list of map items every time an item is added or removed, to recompute the Z value at which the copyright notice should go. Task-number: QTBUG-64880 Change-Id: Ieea77669f0140e43085a76dfd9dfdee40a335f5a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap_p.h')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap_p.h b/src/location/declarativemaps/qdeclarativegeomap_p.h
index 6b765269..f357d322 100644
--- a/src/location/declarativemaps/qdeclarativegeomap_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomap_p.h
@@ -61,6 +61,7 @@
#include <QtGui/QColor>
#include <QtPositioning/qgeorectangle.h>
#include <QtLocation/private/qgeomap_p.h>
+#include <QtQuick/private/qquickitemchangelistener_p.h>
QT_BEGIN_NAMESPACE
@@ -183,6 +184,9 @@ public:
QString errorString() const;
QGeoServiceProvider::Error error() const;
+ // From QQuickItem
+ void itemChange(ItemChange, const ItemChangeData &) override;
+
Q_SIGNALS:
void pluginChanged(QDeclarativeGeoServiceProvider *plugin);
void zoomLevelChanged(qreal zoomLevel);
@@ -233,7 +237,6 @@ protected:
private Q_SLOTS:
void mappingManagerInitialized();
void pluginReady();
- void onMapChildrenChanged();
void onSupportedMapTypesChanged();
void onCameraCapabilitiesChanged(const QGeoCameraCapabilities &oldCameraCapabilities);
void onAttachedCopyrightNoticeVisibilityChanged();
@@ -285,6 +288,8 @@ private:
qreal m_userMaximumFieldOfView;
int m_copyNoticesVisible = 0;
+ qreal m_maxChildZ = 0;
+
friend class QDeclarativeGeoMapItem;
friend class QDeclarativeGeoMapItemView;