summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-11-24 10:11:20 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2022-11-30 10:42:40 +0100
commit0ee94fbbba4f91209e6075fa033cd58300549286 (patch)
tree3f959c74824549654c8e312c22051fa5088713c6 /src
parent8f6bd3b108826e3189d1b7f3280e748a473b2a1b (diff)
downloadqtlocation-0ee94fbbba4f91209e6075fa033cd58300549286.tar.gz
Remove map item backend switch
Change-Id: Ic1ed064269ac73e68d0358b373ea1e8048a1c241 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/location/quickmapitems/qdeclarativecirclemapitem.cpp79
-rw-r--r--src/location/quickmapitems/qdeclarativecirclemapitem_p.h13
-rw-r--r--src/location/quickmapitems/qdeclarativepolygonmapitem.cpp52
-rw-r--r--src/location/quickmapitems/qdeclarativepolygonmapitem_p.h12
-rw-r--r--src/location/quickmapitems/qdeclarativepolylinemapitem.cpp53
-rw-r--r--src/location/quickmapitems/qdeclarativepolylinemapitem_p.h12
-rw-r--r--src/location/quickmapitems/qdeclarativerectanglemapitem.cpp53
-rw-r--r--src/location/quickmapitems/qdeclarativerectanglemapitem_p.h12
8 files changed, 0 insertions, 286 deletions
diff --git a/src/location/quickmapitems/qdeclarativecirclemapitem.cpp b/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
index 927ce6ae..499a9a1a 100644
--- a/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
@@ -265,17 +265,6 @@ void QGeoMapCircleGeometry::updateScreenPointsInvert(const QList<QDoubleVector2D
sourceBounds_ = screenBounds_;
}
-struct CircleBackendSelector
-{
- CircleBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativeCircleMapItem::OpenGL : QDeclarativeCircleMapItem::Software;
- }
- QDeclarativeCircleMapItem::Backend backend = QDeclarativeCircleMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(CircleBackendSelector, mapCircleBackendSelector)
-
QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_border(this), m_color(Qt::transparent), m_dirtyMaterial(true),
m_updatingGeometry(false)
@@ -294,7 +283,6 @@ QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(QQuickItem *parent)
// FIXME: unfortunately they self-intersect at the poles due to current drawing method
// so the line is commented out until fixed
//geometry_.setAssumeSimple(true);
- setBackend(mapCircleBackendSelector->backend);
}
QDeclarativeCircleMapItem::~QDeclarativeCircleMapItem()
@@ -347,7 +335,6 @@ void QDeclarativeCircleMapItem::setCenter(const QGeoCoordinate &center)
if (m_circle.center() == center)
return;
- possiblySwitchBackend(m_circle.center(), m_circle.radius(), center, m_circle.radius());
m_circle.setCenter(center);
m_d->onGeoGeometryChanged();
emit centerChanged(center);
@@ -391,7 +378,6 @@ void QDeclarativeCircleMapItem::setRadius(qreal radius)
if (m_circle.radius() == radius)
return;
- possiblySwitchBackend(m_circle.center(), m_circle.radius(), m_circle.center(), radius);
m_circle.setRadius(radius);
m_d->onGeoGeometryChanged();
emit radiusChanged(radius);
@@ -432,29 +418,6 @@ void QDeclarativeCircleMapItem::updatePolish()
/*!
\internal
-
- The OpenGL backend doesn't do circles crossing poles yet.
- So if that backend is selected and the circle crosses the poles, use the CPU backend instead.
-*/
-void QDeclarativeCircleMapItem::possiblySwitchBackend(const QGeoCoordinate &oldCenter, qreal oldRadius, const QGeoCoordinate &newCenter, qreal newRadius)
-{
- if (m_backend != QDeclarativeCircleMapItem::OpenGL)
- return;
-
- // if old does not cross and new crosses, move to CPU.
- if (!QDeclarativeCircleMapItemPrivate::crossEarthPole(oldCenter, oldRadius)
- && !QDeclarativeCircleMapItemPrivate::crossEarthPole(newCenter, newRadius)) {
- std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateCPU(*this)));
- std::swap(m_d, d);
- } else if (QDeclarativeCircleMapItemPrivate::crossEarthPole(oldCenter, oldRadius)
- && !QDeclarativeCircleMapItemPrivate::crossEarthPole(newCenter, newRadius)) { // else if old crosses and new does not cross, move back to OpenGL
- std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
- std::swap(m_d, d);
- }
-}
-
-/*!
- \internal
*/
void QDeclarativeCircleMapItem::afterViewportChanged(const QGeoMapViewportChangeEvent &event)
{
@@ -486,7 +449,6 @@ void QDeclarativeCircleMapItem::setGeoShape(const QGeoShape &shape)
const QGeoCircle circle(shape); // if shape isn't a circle, circle will be created as a default-constructed circle
const bool centerHasChanged = circle.center() != m_circle.center();
const bool radiusHasChanged = circle.radius() != m_circle.radius();
- possiblySwitchBackend(m_circle.center(), m_circle.radius(), circle.center(), circle.radius());
m_circle = circle;
m_d->onGeoGeometryChanged();
@@ -498,47 +460,6 @@ void QDeclarativeCircleMapItem::setGeoShape(const QGeoShape &shape)
/*!
\internal
- \qmlproperty MapCircle.Backend QtLocation::MapCircle::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapCircle.Software and \b{MapCircle.OpenGL}.
- The default value is \b{MapCircle.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-
-QDeclarativeCircleMapItem::Backend QDeclarativeCircleMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativeCircleMapItem::setBackend(QDeclarativeCircleMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(
- (m_backend == Software) ? static_cast<QDeclarativeCircleMapItemPrivate *>(
- new QDeclarativeCircleMapItemPrivateCPU(*this))
- : static_cast<QDeclarativeCircleMapItemPrivate *>(
- new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
- std::swap(m_d, d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativeCircleMapItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
{
diff --git a/src/location/quickmapitems/qdeclarativecirclemapitem_p.h b/src/location/quickmapitems/qdeclarativecirclemapitem_p.h
index 9e5f4e1a..88a02cfa 100644
--- a/src/location/quickmapitems/qdeclarativecirclemapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativecirclemapitem_p.h
@@ -66,20 +66,13 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeCircleMapItem : public QDeclarativeG
Q_OBJECT
QML_NAMED_ELEMENT(MapCircle)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter NOTIFY centerChanged)
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativeCircleMapItem(QQuickItem *parent = nullptr);
~QDeclarativeCircleMapItem() override;
@@ -101,19 +94,14 @@ public:
const QGeoShape &geoShape() const override;
void setGeoShape(const QGeoShape &shape) override;
- Backend backend() const;
- void setBackend(Backend b);
-
Q_SIGNALS:
void centerChanged(const QGeoCoordinate &center);
void radiusChanged(qreal radius);
void colorChanged(const QColor &color);
- void backendChanged();
protected:
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
void updatePolish() override;
- void possiblySwitchBackend(const QGeoCoordinate &oldCenter, qreal oldRadius, const QGeoCoordinate &newCenter, qreal newRadius);
protected Q_SLOTS:
void markSourceDirtyAndUpdate();
@@ -129,7 +117,6 @@ private:
QColor m_color;
bool m_dirtyMaterial;
bool m_updatingGeometry;
- Backend m_backend = Software;
std::unique_ptr<QDeclarativeCircleMapItemPrivate> m_d;
diff --git a/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp b/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp
index f8125ddb..b8d202a8 100644
--- a/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp
@@ -425,17 +425,6 @@ bool QDeclarativePolygonMapItemPrivateCPU::contains(const QPointF &point) const
* QDeclarativePolygonMapItem Implementation
*/
-struct PolygonBackendSelector
-{
- PolygonBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativePolygonMapItem::OpenGL : QDeclarativePolygonMapItem::Software;
- }
- QDeclarativePolygonMapItem::Backend backend = QDeclarativePolygonMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(PolygonBackendSelector, mapPolygonBackendSelector)
-
QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_border(this), m_color(Qt::transparent), m_dirtyMaterial(true),
m_updatingGeometry(false)
@@ -451,7 +440,6 @@ QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent)
this, &QDeclarativePolygonMapItem::onLinePropertiesChanged);
QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged,
this, &QDeclarativePolygonMapItem::onLinePropertiesChanged);
- setBackend(mapPolygonBackendSelector->backend);
}
QDeclarativePolygonMapItem::~QDeclarativePolygonMapItem()
@@ -479,46 +467,6 @@ QDeclarativeMapLineProperties *QDeclarativePolygonMapItem::border()
/*!
\internal
- \qmlproperty MapPolygon.Backend QtLocation::MapPolygon::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapPolygon.Software and \b{MapPolygon.OpenGL}.
- The default value is \b{MapPolygon.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-QDeclarativePolygonMapItem::Backend QDeclarativePolygonMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativePolygonMapItem::setBackend(QDeclarativePolygonMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativePolygonMapItemPrivate> d(
- (m_backend == Software) ? static_cast<QDeclarativePolygonMapItemPrivate *>(
- new QDeclarativePolygonMapItemPrivateCPU(*this))
- : static_cast<QDeclarativePolygonMapItemPrivate *>(
- new QDeclarativePolygonMapItemPrivateOpenGL(*this)));
- std::swap(m_d, d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativePolygonMapItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
{
diff --git a/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h b/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h
index fae9c626..2726e5bd 100644
--- a/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h
@@ -64,19 +64,12 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolygonMapItem : public QDeclarative
Q_OBJECT
QML_NAMED_ELEMENT(MapPolygon)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativePolygonMapItem(QQuickItem *parent = nullptr);
~QDeclarativePolygonMapItem() override;
@@ -95,9 +88,6 @@ public:
QDeclarativeMapLineProperties *border();
- Backend backend() const;
- void setBackend(Backend b);
-
bool contains(const QPointF &point) const override;
const QGeoShape &geoShape() const override;
void setGeoShape(const QGeoShape &shape) override;
@@ -105,7 +95,6 @@ public:
Q_SIGNALS:
void pathChanged();
void colorChanged(const QColor &color);
- void backendChanged();
protected Q_SLOTS:
void markSourceDirtyAndUpdate();
@@ -123,7 +112,6 @@ public:
QGeoPolygon m_geopoly;
QDeclarativeMapLineProperties m_border;
QColor m_color;
- Backend m_backend = Software;
bool m_dirtyMaterial;
// bool m_dirtyGeometry = false;
bool m_updatingGeometry;
diff --git a/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp b/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp
index 6c1f3c20..73eaf930 100644
--- a/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp
@@ -799,17 +799,6 @@ bool QDeclarativePolylineMapItemPrivateCPU::contains(const QPointF &point) const
* QDeclarativePolygonMapItem Implementation
*/
-struct PolylineBackendSelector
-{
- PolylineBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativePolylineMapItem::OpenGL : QDeclarativePolylineMapItem::Software;
- }
- QDeclarativePolylineMapItem::Backend backend = QDeclarativePolylineMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(PolylineBackendSelector, mapPolylineBackendSelector)
-
QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_line(this),
m_d(new QDeclarativePolylineMapItemPrivateCPU(*this))
@@ -821,7 +810,6 @@ QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
this, &QDeclarativePolylineMapItem::updateAfterLinePropertiesChanged);
QObject::connect(&m_line, &QDeclarativeMapLineProperties::widthChanged,
this, &QDeclarativePolylineMapItem::updateAfterLinePropertiesChanged);
- setBackend(mapPolylineBackendSelector->backend);
}
QDeclarativePolylineMapItem::~QDeclarativePolylineMapItem()
@@ -1062,47 +1050,6 @@ QDeclarativeMapLineProperties *QDeclarativePolylineMapItem::line()
/*!
\internal
- \qmlproperty MapPolyline.Backend QtLocation::MapPolyline::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapPolyline.Software and \b{MapPolyline.OpenGL}.
- The default value is \b{MapPolyline.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-QDeclarativePolylineMapItem::Backend QDeclarativePolylineMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativePolylineMapItem::setBackend(QDeclarativePolylineMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativePolylineMapItemPrivate> d(
- (m_backend == Software)
- ? static_cast<QDeclarativePolylineMapItemPrivate *>(
- new QDeclarativePolylineMapItemPrivateCPU(*this))
- : static_cast<QDeclarativePolylineMapItemPrivate *>(
- new QDeclarativePolylineMapItemPrivateOpenGL(*this)));
- m_d.swap(d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativePolylineMapItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
{
diff --git a/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h b/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h
index 8087aec1..f9c05b12 100644
--- a/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h
@@ -96,18 +96,11 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolylineMapItem : public QDeclarativ
Q_OBJECT
QML_NAMED_ELEMENT(MapPolyline)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *line READ line CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativePolylineMapItem(QQuickItem *parent = nullptr);
~QDeclarativePolylineMapItem();
@@ -134,12 +127,8 @@ public:
QDeclarativeMapLineProperties *line();
- Backend backend() const;
- void setBackend(Backend b);
-
Q_SIGNALS:
void pathChanged();
- void backendChanged();
protected Q_SLOTS:
void updateAfterLinePropertiesChanged();
@@ -156,7 +145,6 @@ public:
QGeoPath m_geopath;
QDeclarativeMapLineProperties m_line;
- Backend m_backend = Software;
bool m_dirtyMaterial = true;
bool m_updatingGeometry = false;
diff --git a/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp b/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp
index 20930d40..8b5b4e43 100644
--- a/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp
@@ -132,17 +132,6 @@ QT_BEGIN_NAMESPACE
\since 5.14
*/
-struct RectangleBackendSelector
-{
- RectangleBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativeRectangleMapItem::OpenGL : QDeclarativeRectangleMapItem::Software;
- }
- QDeclarativeRectangleMapItem::Backend backend = QDeclarativeRectangleMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(RectangleBackendSelector, mapRectangleBackendSelector)
-
QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_border(this),
m_d(new QDeclarativeRectangleMapItemPrivateCPU(*this))
@@ -154,7 +143,6 @@ QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent)
this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged);
QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged,
this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged);
- setBackend(mapRectangleBackendSelector->backend);
}
QDeclarativeRectangleMapItem::~QDeclarativeRectangleMapItem()
@@ -163,47 +151,6 @@ QDeclarativeRectangleMapItem::~QDeclarativeRectangleMapItem()
/*!
\internal
- \qmlproperty MapRectangle.Backend QtLocation::MapRectangle::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapRectangle.Software and \b{MapRectangle.OpenGL}.
- The default value is \b{MapRectangle.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-QDeclarativeRectangleMapItem::Backend QDeclarativeRectangleMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativeRectangleMapItem::setBackend(QDeclarativeRectangleMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativeRectangleMapItemPrivate> d(
- (m_backend == Software) ? static_cast<QDeclarativeRectangleMapItemPrivate *>(
- new QDeclarativeRectangleMapItemPrivateCPU(*this))
- : static_cast<QDeclarativeRectangleMapItemPrivate *>(
- new QDeclarativeRectangleMapItemPrivateOpenGL(*this)));
-
- std::swap(m_d, d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativeRectangleMapItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
{
diff --git a/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h b/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h
index 066ba241..7b0dcd06 100644
--- a/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h
@@ -69,20 +69,13 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeRectangleMapItem: public QDeclarativ
Q_OBJECT
QML_NAMED_ELEMENT(MapRectangle)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft NOTIFY topLeftChanged)
Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight NOTIFY bottomRightChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativeRectangleMapItem(QQuickItem *parent = nullptr);
~QDeclarativeRectangleMapItem() override;
@@ -105,14 +98,10 @@ public:
const QGeoShape &geoShape() const override;
void setGeoShape(const QGeoShape &shape) override;
- Backend backend() const;
- void setBackend(Backend b);
-
Q_SIGNALS:
void topLeftChanged(const QGeoCoordinate &topLeft);
void bottomRightChanged(const QGeoCoordinate &bottomRight);
void colorChanged(const QColor &color);
- void backendChanged();
protected:
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
@@ -130,7 +119,6 @@ private:
bool m_dirtyMaterial = true;
bool m_updatingGeometry = false;
- Backend m_backend = Software;
std::unique_ptr<QDeclarativeRectangleMapItemPrivate> m_d;