30 QML_NAMED_ELEMENT(MapPolygon)
31 QML_ADDED_IN_VERSION(5, 0)
33 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
34 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
35 Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
38 explicit QDeclarativePolygonMapItem(QQuickItem *parent =
nullptr);
39 ~QDeclarativePolygonMapItem() override;
41 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
43 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
45 Q_INVOKABLE
void addCoordinate(
const QGeoCoordinate &coordinate);
46 Q_INVOKABLE
void removeCoordinate(
const QGeoCoordinate &coordinate);
48 QList<QGeoCoordinate> path()
const;
49 void setPath(
const QList<QGeoCoordinate> &value);
52 void setColor(
const QColor &color);
54 QDeclarativeMapLineProperties *border();
56 bool contains(
const QPointF &point)
const override;
57 const QGeoShape &geoShape()
const override;
58 void setGeoShape(
const QGeoShape &shape) override;
62 void colorChanged(
const QColor &color);
65 void markSourceDirtyAndUpdate();
66 void onLinePropertiesChanged();
67 void afterViewportChanged(
const QGeoMapViewportChangeEvent &event) override;
70 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
71 void updatePolish() override;
73#ifdef QT_LOCATION_DEBUG
76 QGeoPolygon m_geopoly;
77 QDeclarativeMapLineProperties m_border;
79 bool m_updatingGeometry;
81 std::unique_ptr<QDeclarativePolygonMapItemPrivate> m_d;
83 friend class QDeclarativePolygonMapItemPrivate;
84 friend class QDeclarativePolygonMapItemPrivateCPU;