diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-11-30 12:12:03 +0100 |
---|---|---|
committer | Matthias Rauter <matthias.rauter@qt.io> | 2023-02-08 09:28:10 +0100 |
commit | 34fccf47ecf8ab2db53b23013f4f402c175ce9de (patch) | |
tree | 48d3ad9eb9d7568e29f0877e8ed9d49da98b6ce1 /src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h | |
parent | cd4db512ae08836f5fa1d746000052215cf70a9c (diff) | |
download | qtlocation-34fccf47ecf8ab2db53b23013f4f402c175ce9de.tar.gz |
Implement all four map items with Shape
With a master switch in qdeclarativegeomapitembase_p.h, this is
enabled by default. For now the old method is still available by
just commenting out the define. The old path can be removed in
follow-up patches; for now keeping both so one can compare and
debug if further issues arise.
Pick-to: 6.5
Change-Id: I01c44ee8a07d7d5f7eb018be33ac5d161ba90e2a
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h')
-rw-r--r-- | src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h b/src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h index bf299d89..e7007a80 100644 --- a/src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h +++ b/src/location/quickmapitems/qdeclarativerectanglemapitem_p_p.h @@ -23,14 +23,14 @@ QT_BEGIN_NAMESPACE +class QQuickShape; +class QQuickShapePath; + class Q_LOCATION_PRIVATE_EXPORT QDeclarativeRectangleMapItemPrivate { Q_DISABLE_COPY_MOVE(QDeclarativeRectangleMapItemPrivate) public: - QDeclarativeRectangleMapItemPrivate(QDeclarativeRectangleMapItem &rect) - : m_rect(rect) - { - } + QDeclarativeRectangleMapItemPrivate(QDeclarativeRectangleMapItem &rect); virtual ~QDeclarativeRectangleMapItemPrivate(); virtual void onLinePropertiesChanged() = 0; @@ -49,11 +49,7 @@ public: class Q_LOCATION_PRIVATE_EXPORT QDeclarativeRectangleMapItemPrivateCPU: public QDeclarativeRectangleMapItemPrivate { public: - QDeclarativeRectangleMapItemPrivateCPU(QDeclarativeRectangleMapItem &rect) - : QDeclarativeRectangleMapItemPrivate(rect) - { - } - + QDeclarativeRectangleMapItemPrivateCPU(QDeclarativeRectangleMapItem &rect); ~QDeclarativeRectangleMapItemPrivateCPU() override; void onLinePropertiesChanged() override @@ -64,7 +60,9 @@ public: void markSourceDirtyAndUpdate() override { m_geometry.markSourceDirty(); +#ifndef MAPITEMS_USE_SHAPES m_borderGeometry.markSourceDirty(); +#endif m_rect.polishAndUpdate(); } void onMapSet() override @@ -78,13 +76,17 @@ public: void onItemGeometryChanged() override { m_geometry.setPreserveGeometry(true, m_rect.m_rectangle.topLeft()); +#ifndef MAPITEMS_USE_SHAPES m_borderGeometry.setPreserveGeometry(true, m_rect.m_rectangle.topLeft()); +#endif markSourceDirtyAndUpdate(); } void afterViewportChanged() override { m_geometry.setPreserveGeometry(true, m_rect.m_rectangle.topLeft()); +#ifndef MAPITEMS_USE_SHAPES m_borderGeometry.setPreserveGeometry(true, m_rect.m_rectangle.topLeft()); +#endif markSourceDirtyAndUpdate(); } void updatePolish() override; @@ -92,8 +94,14 @@ public: bool contains(const QPointF &point) const override; 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 |