35 QML_NAMED_ELEMENT(MapRectangle)
36 QML_ADDED_IN_VERSION(5, 0)
38 Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft NOTIFY topLeftChanged)
39 Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight NOTIFY bottomRightChanged)
40 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
41 Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
44 explicit QDeclarativeRectangleMapItem(QQuickItem *parent =
nullptr);
45 ~QDeclarativeRectangleMapItem() override;
47 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
49 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
51 QGeoCoordinate topLeft();
52 void setTopLeft(
const QGeoCoordinate ¢er);
54 QGeoCoordinate bottomRight();
55 void setBottomRight(
const QGeoCoordinate ¢er);
58 void setColor(
const QColor &color);
60 QDeclarativeMapLineProperties *border();
62 bool contains(
const QPointF &point)
const override;
63 const QGeoShape &geoShape()
const override;
64 void setGeoShape(
const QGeoShape &shape) override;
67 void topLeftChanged(
const QGeoCoordinate &topLeft);
68 void bottomRightChanged(
const QGeoCoordinate &bottomRight);
69 void colorChanged(
const QColor &color);
72 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
73 void updatePolish() override;
76 void markSourceDirtyAndUpdate();
77 void onLinePropertiesChanged();
78 void afterViewportChanged(
const QGeoMapViewportChangeEvent &event) override;
81 QGeoRectangle m_rectangle;
82 QDeclarativeMapLineProperties m_border;
83 QColor m_color = Qt::transparent;
85 bool m_updatingGeometry =
false;
87 std::unique_ptr<QDeclarativeRectangleMapItemPrivate> m_d;
89 friend class QDeclarativeRectangleMapItemPrivate;
90 friend class QDeclarativeRectangleMapItemPrivateCPU;