summaryrefslogtreecommitdiff
path: root/src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h')
-rw-r--r--src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h b/src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h
index 8595bd7b..80f2159c 100644
--- a/src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h
+++ b/src/location/quickmapitems/qdeclarativepolygonmapitem_p_p.h
@@ -32,6 +32,9 @@
QT_BEGIN_NAMESPACE
+class QQuickShape;
+class QQuickShapePath;
+
class Q_LOCATION_PRIVATE_EXPORT QGeoMapPolygonGeometry : public QGeoMapItemGeometry
{
public:
@@ -42,13 +45,20 @@ public:
void updateSourcePoints(const QGeoMap &map,
const QList<QDoubleVector2D> &path);
+#ifndef MAPITEMS_USE_SHAPES
void updateScreenPoints(const QGeoMap &map, qreal strokeWidth = 0.0);
+#endif
+
+ QPainterPath srcPath() const { return srcPath_; }
+ qreal maxCoord() const { return maxCoord_; }
protected:
QPainterPath srcPath_;
+ qreal maxCoord_ = 0.0;
bool assumeSimple_ = false;
};
+#ifndef MAPITEMS_USE_SHAPES
class Q_LOCATION_PRIVATE_EXPORT MapPolygonNode : public MapItemGeometryNode
{
@@ -64,6 +74,7 @@ private:
MapPolylineNode *border_;
QSGGeometry geometry_;
};
+#endif
class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolygonMapItemPrivate
{
@@ -92,12 +103,9 @@ public:
class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolygonMapItemPrivateCPU: public QDeclarativePolygonMapItemPrivate
{
public:
- QDeclarativePolygonMapItemPrivateCPU(QDeclarativePolygonMapItem &polygon)
- : QDeclarativePolygonMapItemPrivate(polygon)
- {
- }
-
+ QDeclarativePolygonMapItemPrivateCPU(QDeclarativePolygonMapItem &polygon);
~QDeclarativePolygonMapItemPrivateCPU() override;
+
void onLinePropertiesChanged() override
{
// mark dirty just in case we're a width change
@@ -107,7 +115,9 @@ public:
{
// preserveGeometry is cleared in updateMapItemPaintNode
m_geometry.markSourceDirty();
+#ifndef MAPITEMS_USE_SHAPES
m_borderGeometry.markSourceDirty();
+#endif
m_poly.polishAndUpdate();
}
void regenerateCache()
@@ -130,7 +140,9 @@ public:
void preserveGeometry()
{
m_geometry.setPreserveGeometry(true, m_poly.m_geopoly.boundingGeoRectangle().topLeft());
+#ifndef MAPITEMS_USE_SHAPES
m_borderGeometry.setPreserveGeometry(true, m_poly.m_geopoly.boundingGeoRectangle().topLeft());
+#endif
}
void afterViewportChanged() override
{
@@ -165,8 +177,14 @@ public:
QList<QDoubleVector2D> m_geopathProjected;
QGeoMapPolygonGeometry m_geometry;
+#ifdef MAPITEMS_USE_SHAPES
+ QQuickShape *m_shape = nullptr;
+ QQuickShapePath *m_shapePath = nullptr;
+ QDeclarativeGeoMapPainterPath *m_painterPath = nullptr;
+#else
QGeoMapPolylineGeometry m_borderGeometry;
MapPolygonNode *m_node = nullptr;
+#endif
};
QT_END_NAMESPACE