29 QML_NAMED_ELEMENT(MapPolygon)
30 QML_ADDED_IN_VERSION(5, 0)
32 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
33 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
34 Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
37 explicit QDeclarativePolygonMapItem(QQuickItem *parent =
nullptr);
38 ~QDeclarativePolygonMapItem() override;
40 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
42 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
44 Q_INVOKABLE
void addCoordinate(
const QGeoCoordinate &coordinate);
45 Q_INVOKABLE
void removeCoordinate(
const QGeoCoordinate &coordinate);
47 QList<QGeoCoordinate> path()
const;
48 void setPath(
const QList<QGeoCoordinate> &value);
51 void setColor(
const QColor &color);
53 QDeclarativeMapLineProperties *border();
55 bool contains(
const QPointF &point)
const override;
56 const QGeoShape &geoShape()
const override;
57 void setGeoShape(
const QGeoShape &shape) override;
61 void colorChanged(
const QColor &color);
64 void markSourceDirtyAndUpdate();
65 void onLinePropertiesChanged();
66 void afterViewportChanged(
const QGeoMapViewportChangeEvent &event) override;
69 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
70 void updatePolish() override;
72#ifdef QT_LOCATION_DEBUG
75 QGeoPolygon m_geopoly;
76 QDeclarativeMapLineProperties m_border;
78 bool m_updatingGeometry;
80 std::unique_ptr<QDeclarativePolygonMapItemPrivate> m_d;
82 friend class QDeclarativePolygonMapItemPrivate;
83 friend class QDeclarativePolygonMapItemPrivateCPU;