summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/declarativemaps')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomaneuver_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase_p.h4
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroute_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel.cpp2
-rw-r--r--src/location/declarativemaps/qdeclarativegeoroutemodel_p.h4
-rw-r--r--src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h2
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp17
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem_p.h8
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem.cpp69
-rw-r--r--src/location/declarativemaps/qdeclarativepolylinemapitem_p.h27
-rw-r--r--src/location/declarativemaps/qgeomapobject.cpp5
12 files changed, 98 insertions, 46 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomaneuver_p.h b/src/location/declarativemaps/qdeclarativegeomaneuver_p.h
index f321c133..4c79aa80 100644
--- a/src/location/declarativemaps/qdeclarativegeomaneuver_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomaneuver_p.h
@@ -71,7 +71,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoManeuver : public QObject
Q_PROPERTY(qreal distanceToNextInstruction READ distanceToNextInstruction CONSTANT)
Q_PROPERTY(QGeoCoordinate waypoint READ waypoint CONSTANT)
Q_PROPERTY(bool waypointValid READ waypointValid CONSTANT)
- Q_PROPERTY(QObject *extendedAttributes READ extendedAttributes NOTIFY extendedAttributesChanged)
+ Q_PROPERTY(QObject *extendedAttributes READ extendedAttributes NOTIFY extendedAttributesChanged REVISION 11)
public:
enum Direction {
diff --git a/src/location/declarativemaps/qdeclarativegeomap_p.h b/src/location/declarativemaps/qdeclarativegeomap_p.h
index cb8fed08..7f1bf7ab 100644
--- a/src/location/declarativemaps/qdeclarativegeomap_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomap_p.h
@@ -225,7 +225,7 @@ Q_SIGNALS:
void copyrightsChanged(const QImage &copyrightsImage);
void copyrightsChanged(const QString &copyrightsHtml);
void mapReadyChanged(bool ready);
- void mapObjectsChanged();
+ Q_REVISION(11) void mapObjectsChanged();
protected:
void mousePressEvent(QMouseEvent *event) override ;
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
index 603bcafd..7a284e8a 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
@@ -132,8 +132,8 @@ public:
Q_SIGNALS:
void mapItemOpacityChanged();
- void enterTransitionFinished();
- void exitTransitionFinished();
+ Q_REVISION(11) void enterTransitionFinished();
+ Q_REVISION(11) void exitTransitionFinished();
protected Q_SLOTS:
virtual void afterChildrenChanged();
diff --git a/src/location/declarativemaps/qdeclarativegeoroute_p.h b/src/location/declarativemaps/qdeclarativegeoroute_p.h
index 5fe29862..7e7ae368 100644
--- a/src/location/declarativemaps/qdeclarativegeoroute_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoroute_p.h
@@ -67,7 +67,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRoute : public QObject
Q_PROPERTY(qreal distance READ distance CONSTANT)
Q_PROPERTY(QJSValue path READ path WRITE setPath NOTIFY pathChanged)
Q_PROPERTY(QQmlListProperty<QDeclarativeGeoRouteSegment> segments READ segments CONSTANT)
- Q_PROPERTY(QDeclarativeGeoRouteQuery *routeQuery READ routeQuery)
+ Q_PROPERTY(QDeclarativeGeoRouteQuery *routeQuery READ routeQuery REVISION 11)
public:
explicit QDeclarativeGeoRoute(QObject *parent = 0);
diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
index 0f0bb253..4ddd1f5b 100644
--- a/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
+++ b/src/location/declarativemaps/qdeclarativegeoroutemodel.cpp
@@ -1826,8 +1826,6 @@ void QDeclarativeGeoWaypoint::setBearing(qreal bearing)
defined by the user, these can be set by using MapParameters.
If the waypoint comes from the engine via signals, or as part of a read-only route query,
the waypoint is intended to be read-only.
-
- \since 5.11
*/
QVariantMap QDeclarativeGeoWaypoint::metadata()
{
diff --git a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
index 64c1ebf8..afffc21a 100644
--- a/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoroutemodel_p.h
@@ -295,7 +295,7 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoRouteQuery : public QObject, publ
Q_PROPERTY(QVariantList waypoints READ waypoints WRITE setWaypoints NOTIFY waypointsChanged)
Q_PROPERTY(QJSValue excludedAreas READ excludedAreas WRITE setExcludedAreas NOTIFY excludedAreasChanged)
Q_PROPERTY(QList<int> featureTypes READ featureTypes NOTIFY featureTypesChanged)
- Q_PROPERTY(QVariantMap extraParameters READ extraParameters)
+ Q_PROPERTY(QVariantMap extraParameters READ extraParameters REVISION 11)
Q_PROPERTY(QQmlListProperty<QObject> quickChildren READ declarativeChildren DESIGNABLE false)
Q_CLASSINFO("DefaultProperty", "quickChildren")
Q_INTERFACES(QQmlParserStatus)
@@ -434,7 +434,7 @@ Q_SIGNALS:
void segmentDetailChanged();
void queryDetailsChanged();
- void extraParametersChanged();
+ Q_REVISION(11) void extraParametersChanged();
private Q_SLOTS:
void excludedAreaCoordinateChanged();
diff --git a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h
index 13768411..f6a663f3 100644
--- a/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h
+++ b/src/location/declarativemaps/qdeclarativegeoserviceprovider_p.h
@@ -206,7 +206,7 @@ public:
Q_INVOKABLE bool supportsGeocoding(const GeocodingFeatures &feature = AnyGeocodingFeatures) const;
Q_INVOKABLE bool supportsMapping(const MappingFeatures &feature = AnyMappingFeatures) const;
Q_INVOKABLE bool supportsPlaces(const PlacesFeatures &feature = AnyPlacesFeatures) const;
- Q_INVOKABLE bool supportsNavigation(const NavigationFeature &feature = AnyNavigationFeatures) const;
+ Q_REVISION(11) Q_INVOKABLE bool supportsNavigation(const NavigationFeature &feature = AnyNavigationFeatures) const;
QStringList locales() const;
void setLocales(const QStringList &locales);
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
index 9e96f3c6..eab0f214 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
@@ -654,8 +654,7 @@ void QDeclarativePolygonMapItem::geometryChanged(const QRectF &newGeometry, cons
MapPolygonNode::MapPolygonNode() :
border_(new MapPolylineNode()),
- geometry_(QSGGeometry::defaultAttributes_Point2D(), 0),
- blocked_(true)
+ geometry_(QSGGeometry::defaultAttributes_Point2D(), 0)
{
geometry_.setDrawingMode(QSGGeometry::DrawTriangles);
QSGGeometryNode::setMaterial(&fill_material_);
@@ -671,14 +670,6 @@ MapPolygonNode::~MapPolygonNode()
/*!
\internal
*/
-bool MapPolygonNode::isSubtreeBlocked() const
-{
- return blocked_;
-}
-
-/*!
- \internal
-*/
void MapPolygonNode::update(const QColor &fillColor, const QColor &borderColor,
const QGeoMapItemGeometry *fillShape,
const QGeoMapItemGeometry *borderShape)
@@ -692,13 +683,13 @@ void MapPolygonNode::update(const QColor &fillColor, const QColor &borderColor,
* accuracy) */
if (fillShape->size() == 0) {
if (borderShape->size() == 0) {
- blocked_ = true;
+ setSubtreeBlocked(true);
return;
} else {
- blocked_ = false;
+ setSubtreeBlocked(false);
}
} else {
- blocked_ = false;
+ setSubtreeBlocked(false);
}
QSGGeometry *fill = QSGGeometryNode::geometry();
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
index febeb751..83983651 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h
@@ -137,24 +137,20 @@ private:
//////////////////////////////////////////////////////////////////////
-class Q_LOCATION_PRIVATE_EXPORT MapPolygonNode : public QSGGeometryNode
+class Q_LOCATION_PRIVATE_EXPORT MapPolygonNode : public MapItemGeometryNode
{
public:
MapPolygonNode();
- ~MapPolygonNode();
+ ~MapPolygonNode() override;
void update(const QColor &fillColor, const QColor &borderColor,
const QGeoMapItemGeometry *fillShape,
const QGeoMapItemGeometry *borderShape);
-
- bool isSubtreeBlocked() const override;
-
private:
QSGFlatColorMaterial fill_material_;
MapPolylineNode *border_;
QSGGeometry geometry_;
- bool blocked_;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
index c880ab00..2dab58e9 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem.cpp
@@ -1013,29 +1013,76 @@ QGeoMap::ItemType QDeclarativePolylineMapItem::itemType() const
/*!
\internal
*/
-MapPolylineNode::MapPolylineNode() :
- geometry_(QSGGeometry::defaultAttributes_Point2D(),0),
- blocked_(true)
+VisibleNode::VisibleNode() : m_blocked{true}, m_visible{true}
{
- geometry_.setDrawingMode(QSGGeometry::DrawTriangleStrip);
- QSGGeometryNode::setMaterial(&fill_material_);
- QSGGeometryNode::setGeometry(&geometry_);
+
}
+VisibleNode::~VisibleNode()
+{
+
+}
/*!
\internal
*/
-MapPolylineNode::~MapPolylineNode()
+bool VisibleNode::subtreeBlocked() const
+{
+ return m_blocked || !m_visible;
+}
+
+/*!
+ \internal
+*/
+void VisibleNode::setSubtreeBlocked(bool blocked)
+{
+ m_blocked = blocked;
+}
+
+bool VisibleNode::visible() const
+{
+ return m_visible;
+}
+
+/*!
+ \internal
+*/
+void VisibleNode::setVisible(bool visible)
{
+ m_visible = visible;
}
/*!
\internal
*/
-bool MapPolylineNode::isSubtreeBlocked() const
+MapItemGeometryNode::~MapItemGeometryNode()
+{
+
+}
+
+bool MapItemGeometryNode::isSubtreeBlocked() const
+{
+ return subtreeBlocked();
+}
+
+
+/*!
+ \internal
+*/
+MapPolylineNode::MapPolylineNode() :
+ geometry_(QSGGeometry::defaultAttributes_Point2D(),0)
+{
+ geometry_.setDrawingMode(QSGGeometry::DrawTriangleStrip);
+ QSGGeometryNode::setMaterial(&fill_material_);
+ QSGGeometryNode::setGeometry(&geometry_);
+}
+
+
+/*!
+ \internal
+*/
+MapPolylineNode::~MapPolylineNode()
{
- return blocked_;
}
/*!
@@ -1045,10 +1092,10 @@ void MapPolylineNode::update(const QColor &fillColor,
const QGeoMapItemGeometry *shape)
{
if (shape->size() == 0) {
- blocked_ = true;
+ setSubtreeBlocked(true);
return;
} else {
- blocked_ = false;
+ setSubtreeBlocked(false);
}
QSGGeometry *fill = QSGGeometryNode::geometry();
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h b/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
index ca01de12..225f21d9 100644
--- a/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
+++ b/src/location/declarativemaps/qdeclarativepolylinemapitem_p.h
@@ -181,20 +181,39 @@ private:
//////////////////////////////////////////////////////////////////////
-class Q_LOCATION_PRIVATE_EXPORT MapPolylineNode : public QSGGeometryNode
+class Q_LOCATION_PRIVATE_EXPORT VisibleNode
{
+public:
+ VisibleNode();
+ virtual ~VisibleNode();
+
+ bool subtreeBlocked() const;
+ void setSubtreeBlocked(bool blocked);
+ bool visible() const;
+ void setVisible(bool visible);
+
+ bool m_blocked : 1;
+ bool m_visible : 1;
+};
+class Q_LOCATION_PRIVATE_EXPORT MapItemGeometryNode : public QSGGeometryNode, public VisibleNode
+{
+public:
+ ~MapItemGeometryNode() override;
+ bool isSubtreeBlocked() const override;
+};
+
+class Q_LOCATION_PRIVATE_EXPORT MapPolylineNode : public MapItemGeometryNode
+{
public:
MapPolylineNode();
- ~MapPolylineNode();
+ ~MapPolylineNode() override;
void update(const QColor &fillColor, const QGeoMapItemGeometry *shape);
- bool isSubtreeBlocked() const override;
private:
QSGFlatColorMaterial fill_material_;
QSGGeometry geometry_;
- bool blocked_;
};
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qgeomapobject.cpp b/src/location/declarativemaps/qgeomapobject.cpp
index 391ac04c..9a2e37bd 100644
--- a/src/location/declarativemaps/qgeomapobject.cpp
+++ b/src/location/declarativemaps/qgeomapobject.cpp
@@ -198,8 +198,8 @@ void QGeoMapObject::setMap(QGeoMap *map)
// old implementation gets destroyed if/when d_ptr gets replaced
d_ptr->m_componentCompleted = oldCmponentCompleted;
d_ptr->setVisible(oldVisible);
+ d_ptr->setMap(map);
}
- d_ptr->setMap(map);
const QList<QGeoMapObject *> kids = geoMapObjectChildren();
for (auto kid : kids)
@@ -207,7 +207,8 @@ void QGeoMapObject::setMap(QGeoMap *map)
// Each subclass is in charge to do the equivalent of
// if (!map) {
- // // Map was set, now it has ben re-set to NULL
+ // // Map was set, now it has ben re-set to NULL, but not inside d_ptr.
+ // // so m_map inside d_ptr can still be used to remove itself, inside the destructor.
// d_ptr = new QMapCircleObjectPrivateDefault(*d);
// // Old pimpl deleted implicitly by QExplicitlySharedDataPointer
// }