diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-19 00:30:19 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-30 09:29:09 +0000 |
commit | 0a5dd29d4b02a192ec7e691cf88f623152ce100b (patch) | |
tree | 9d1975b4cf1f61ed3aa56af8d98443632e8c21ba /src/location/declarativemaps/qdeclarativegeomapquickitem.cpp | |
parent | 1946896ace3f5fa8b6086fb416ea934fea387f12 (diff) | |
download | qtlocation-0a5dd29d4b02a192ec7e691cf88f623152ce100b.tar.gz |
Allow QGeoMap to render map items
Currently QtLocation Map items are always rendered by
QtLocation, on top of what QGeoMap generates.
This patch introduces a new private api call to QGeoMap,
supportedMapItemTypes(), that is used to inform QtLocation
to not render map items of those types, but rather
pass them over to the QGeoMap, which will take care of
the rendering.
In this way, more advanced renderers can properly render
map items, for example below labels or 3D buildings.
Change-Id: I1c82d4f11d4dd44c3011926512520d62e26295d4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapquickitem.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomapquickitem.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp index b3b8aa8a..c5c336b5 100644 --- a/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp +++ b/src/location/declarativemaps/qdeclarativegeomapquickitem.cpp @@ -149,7 +149,7 @@ void QDeclarativeGeoMapQuickItem::setCoordinate(const QGeoCoordinate &coordinate geoshape_.setTopLeft(coordinate_); geoshape_.setBottomRight(coordinate_); // TODO: Handle zoomLevel != 0.0 - + markGeoGeometryDirty(); polishAndUpdate(); emit coordinateChanged(); } @@ -204,7 +204,7 @@ void QDeclarativeGeoMapQuickItem::setSourceItem(QQuickItem *sourceItem) if (sourceItem_.data() == sourceItem) return; sourceItem_ = sourceItem; - + markGeoGeometryDirty(); // This is equivalent to geometry polishAndUpdate(); emit sourceItemChanged(); } @@ -250,6 +250,7 @@ void QDeclarativeGeoMapQuickItem::setAnchorPoint(const QPointF &anchorPoint) if (anchorPoint == anchorPoint_) return; anchorPoint_ = anchorPoint; + markGeoGeometryDirty(); // This is equivalent to geometry polishAndUpdate(); emit anchorPointChanged(); } @@ -282,6 +283,7 @@ void QDeclarativeGeoMapQuickItem::setZoomLevel(qreal zoomLevel) if (zoomLevel == zoomLevel_) return; zoomLevel_ = zoomLevel; + markGeoGeometryDirty(); // This is equivalent to geometry // TODO: update geoshape_! polishAndUpdate(); emit zoomLevelChanged(); @@ -299,6 +301,11 @@ const QGeoShape &QDeclarativeGeoMapQuickItem::geoShape() const return geoshape_; } +QGeoMap::ItemType QDeclarativeGeoMapQuickItem::itemType() const +{ + return QGeoMap::MapQuickItem; +} + /*! \internal */ |