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/maps/qgeomap_p.h | |
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/maps/qgeomap_p.h')
-rw-r--r-- | src/location/maps/qgeomap_p.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h index 7f9fca8c..4838cb4e 100644 --- a/src/location/maps/qgeomap_p.h +++ b/src/location/maps/qgeomap_p.h @@ -63,6 +63,7 @@ class QGeoCoordinate; class QSGNode; class QQuickWindow; class QGeoMapParameter; +class QDeclarativeGeoMapItemBase; class Q_LOCATION_EXPORT QGeoMap : public QObject { @@ -70,6 +71,18 @@ class Q_LOCATION_EXPORT QGeoMap : public QObject Q_DECLARE_PRIVATE(QGeoMap) public: + enum ItemType { + NoItem = 0x0000, + MapRectangle = 0x0001, + MapCircle = 0x0002, + MapPolyline = 0x0004, + MapPolygon = 0x0008, + MapQuickItem = 0x0010, + CustomMapItem = 0x8000 + }; + + Q_DECLARE_FLAGS(ItemTypes, ItemType) + virtual ~QGeoMap(); // Sets the display size @@ -102,6 +115,12 @@ public: void removeParameter(QGeoMapParameter *param); void clearParameters(); + ItemTypes supportedMapItemTypes() const; + + void addMapItem(QDeclarativeGeoMapItemBase *item); + void removeMapItem(QDeclarativeGeoMapItemBase *item); + void clearMapItems(); + protected: QGeoMap(QGeoMapPrivate &dd, QObject *parent = 0); void setCameraData(const QGeoCameraData &cameraData); @@ -119,6 +138,8 @@ private: friend class QDeclarativeGeoMap; //updateSceneGraph }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoMap::ItemTypes) + QT_END_NAMESPACE #endif // QGEOMAP_P_H |