34 QML_NAMED_ELEMENT(MapRectangle)
35 QML_ADDED_IN_VERSION(5, 0)
37 Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft NOTIFY topLeftChanged)
38 Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight NOTIFY bottomRightChanged)
39 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
40 Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
43 explicit QDeclarativeRectangleMapItem(QQuickItem *parent =
nullptr);
44 ~QDeclarativeRectangleMapItem() override;
46 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
48 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
50 QGeoCoordinate topLeft();
51 void setTopLeft(
const QGeoCoordinate ¢er);
53 QGeoCoordinate bottomRight();
54 void setBottomRight(
const QGeoCoordinate ¢er);
57 void setColor(
const QColor &color);
59 QDeclarativeMapLineProperties *border();
61 bool contains(
const QPointF &point)
const override;
62 const QGeoShape &geoShape()
const override;
63 void setGeoShape(
const QGeoShape &shape) override;
66 void topLeftChanged(
const QGeoCoordinate &topLeft);
67 void bottomRightChanged(
const QGeoCoordinate &bottomRight);
68 void colorChanged(
const QColor &color);
71 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
72 void updatePolish() override;
75 void markSourceDirtyAndUpdate();
76 void onLinePropertiesChanged();
77 void afterViewportChanged(
const QGeoMapViewportChangeEvent &event) override;
80 QGeoRectangle m_rectangle;
81 QDeclarativeMapLineProperties m_border;
82 QColor m_color = Qt::transparent;
84 bool m_updatingGeometry =
false;
86 std::unique_ptr<QDeclarativeRectangleMapItemPrivate> m_d;
88 friend class QDeclarativeRectangleMapItemPrivate;
89 friend class QDeclarativeRectangleMapItemPrivateCPU;