summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-01-19 00:30:19 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-01-30 09:29:09 +0000
commit0a5dd29d4b02a192ec7e691cf88f623152ce100b (patch)
tree9d1975b4cf1f61ed3aa56af8d98443632e8c21ba /src/location/declarativemaps/qdeclarativecirclemapitem.cpp
parent1946896ace3f5fa8b6086fb416ea934fea387f12 (diff)
downloadqtlocation-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/qdeclarativecirclemapitem.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativecirclemapitem.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
index 39581dce..f5127c5e 100644
--- a/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativecirclemapitem.cpp
@@ -375,6 +375,10 @@ QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(QQuickItem *parent)
this, SLOT(markSourceDirtyAndUpdate()));
QObject::connect(&border_, SIGNAL(widthChanged(qreal)),
this, SLOT(markSourceDirtyAndUpdate()));
+ QObject::connect(&border_, SIGNAL(colorChanged(QColor)),
+ this, SLOT(markGeoMaterialDirty()));
+ QObject::connect(&border_, SIGNAL(widthChanged(qreal)),
+ this, SLOT(markGeoMaterialDirty()));
// assume that circles are not self-intersecting
// to speed up processing
@@ -432,6 +436,7 @@ void QDeclarativeCircleMapItem::setCenter(const QGeoCoordinate &center)
return;
circle_.setCenter(center);
+ markGeoGeometryDirty();
markSourceDirtyAndUpdate();
emit centerChanged(center);
}
@@ -453,6 +458,7 @@ void QDeclarativeCircleMapItem::setColor(const QColor &color)
return;
color_ = color;
dirtyMaterial_ = true;
+ geoMaterialDirty_ = true;
update();
emit colorChanged(color_);
}
@@ -475,6 +481,7 @@ void QDeclarativeCircleMapItem::setRadius(qreal radius)
return;
circle_.setRadius(radius);
+ markGeoGeometryDirty();
markSourceDirtyAndUpdate();
emit radiusChanged(radius);
}
@@ -616,6 +623,11 @@ const QGeoShape &QDeclarativeCircleMapItem::geoShape() const
return circle_;
}
+QGeoMap::ItemType QDeclarativeCircleMapItem::itemType() const
+{
+ return QGeoMap::MapCircle;
+}
+
/*!
\internal
*/