summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-01-30 21:47:38 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-01-31 09:33:44 +0000
commitfa58926f51b532bd82baf9cd9f1e75548139235a (patch)
tree1e40a6077d24da899bf5c90d7a1e98648e1a275f /src/location/declarativemaps/qdeclarativegeomapitembase_p.h
parent9ef81d240ad8d27ea482f9a15d2647a6eee1f7f2 (diff)
downloadqtlocation-fa58926f51b532bd82baf9cd9f1e75548139235a.tar.gz
Add mapItemOpacity signal to QDeclarativeGeoMapItemBase
Map items are different from regular QQuickItems in that they could be rendered externally of the qtquick scene graph renderer. With the introduction of MapItemGroups, the opacity of map items can be changed not only by setting the opacity property of an item, but also by changing the opacity property of a MapItemGroup, which would affect the opacity of all the items contained inside. When these items are handed over to a plugin for rendering, it becomes therefore impossible to know when the opacity of the group changes. The new signal mapItemOpacity serves the purpose of communicating whether either the opacity property of an item, or the opacity property of its MapItemGroup parent (if the item happens to be inside a group) changes. The associated mapItemOpacity is then in charge of returning the correct combined opacity of the item. Change-Id: I0ecbd1fc4c220291209e649bb44848854760f682 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapitembase_p.h')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
index ff887676..3755cfa1 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
@@ -97,13 +97,16 @@ public:
virtual QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *);
virtual QGeoMap::ItemType itemType() const = 0;
-
+ qreal mapItemOpacity() const;
// Data-related bool. Used by QGeoMaps that render the item directly.
bool isDirty() const;
bool isGeoMaterialDirty() const;
bool isGeoGeometryDirty() const;
void markClean();
+Q_SIGNALS:
+ void mapItemOpacityChanged();
+
protected Q_SLOTS:
virtual void afterChildrenChanged();
virtual void afterViewportChanged(const QGeoMapViewportChangeEvent &event) = 0;
@@ -138,6 +141,8 @@ private:
QSizeF lastSize_;
QGeoCameraData lastCameraData_;
+ QDeclarativeGeoMapItemGroup *parentGroup_;
+
friend class QDeclarativeGeoMap;
};