From 0ee94fbbba4f91209e6075fa033cd58300549286 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 24 Nov 2022 10:11:20 +0100 Subject: Remove map item backend switch Change-Id: Ic1ed064269ac73e68d0358b373ea1e8048a1c241 Reviewed-by: Volker Hilsheimer --- .../location/geojson_viewer/GeoJsonDelegate.qml | 3 - examples/location/geojson_viewer/main.qml | 8 --- .../quickmapitems/qdeclarativecirclemapitem.cpp | 79 ---------------------- .../quickmapitems/qdeclarativecirclemapitem_p.h | 13 ---- .../quickmapitems/qdeclarativepolygonmapitem.cpp | 52 -------------- .../quickmapitems/qdeclarativepolygonmapitem_p.h | 12 ---- .../quickmapitems/qdeclarativepolylinemapitem.cpp | 53 --------------- .../quickmapitems/qdeclarativepolylinemapitem_p.h | 12 ---- .../quickmapitems/qdeclarativerectanglemapitem.cpp | 53 --------------- .../quickmapitems/qdeclarativerectanglemapitem_p.h | 12 ---- tests/manual/mapitems_backends/main.qml | 43 ------------ tests/manual/mapobjects_tester/main.qml | 35 ---------- tests/manual/mappolyline_tester/main.qml | 23 ------- 13 files changed, 398 deletions(-) diff --git a/examples/location/geojson_viewer/GeoJsonDelegate.qml b/examples/location/geojson_viewer/GeoJsonDelegate.qml index d5b9b3e9..c9e43be3 100644 --- a/examples/location/geojson_viewer/GeoJsonDelegate.qml +++ b/examples/location/geojson_viewer/GeoJsonDelegate.qml @@ -59,7 +59,6 @@ DelegateChooser { role: "type" property color defaultColor: "grey" property real defaultOpacity: 0.6 - property bool openGLBackends: false DelegateChoice { roleValue: "Point" @@ -83,7 +82,6 @@ DelegateChooser { delegate: MapPolyline { property string geojsonType: "LineString" property var props: modelData.properties - backend: (dc.openGLBackends) ? MapPolyline.OpenGL : MapPolyline.Software geoShape: modelData.data line.width: 4 opacity: dc.defaultOpacity @@ -101,7 +99,6 @@ DelegateChooser { color: (props && props.color) || (parent && parent.props && parent.props.color) || dc.defaultColor border.width: 4 border.color: 'black' - backend: (dc.openGLBackends) ? MapPolygon.OpenGL : MapPolygon.Software MouseArea { anchors.fill: parent onClicked: { diff --git a/examples/location/geojson_viewer/main.qml b/examples/location/geojson_viewer/main.qml index 3c42d9a5..85d0e07d 100644 --- a/examples/location/geojson_viewer/main.qml +++ b/examples/location/geojson_viewer/main.qml @@ -64,7 +64,6 @@ ApplicationWindow { height: 1024 menuBar: mainMenu title: qsTr("GeoJSON Viewer") - property bool openGLBackends: glBackendSelector.checked FileDialog { visible: false @@ -140,12 +139,6 @@ ApplicationWindow { geoJsoner.print(miv) } } - MenuItem { - text: "OpenGL Item backends" - id: glBackendSelector - checkable: true - checked: false - } } } @@ -173,7 +166,6 @@ ApplicationWindow { id: miv model: geoJsoner.model delegate: GeoJsonDelegate { - openGLBackends: win.openGLBackends } } } 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 QListbackend); } QDeclarativeCircleMapItem::~QDeclarativeCircleMapItem() @@ -347,7 +335,6 @@ void QDeclarativeCircleMapItem::setCenter(const QGeoCoordinate ¢er) 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); @@ -430,29 +416,6 @@ void QDeclarativeCircleMapItem::updatePolish() m_d->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 d(static_cast(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 d(static_cast(new QDeclarativeCircleMapItemPrivateOpenGL(*this))); - std::swap(m_d, d); - } -} - /*! \internal */ @@ -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(); @@ -496,47 +458,6 @@ void QDeclarativeCircleMapItem::setGeoShape(const QGeoShape &shape) emit radiusChanged(m_circle.radius()); } -/*! - \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 d( - (m_backend == Software) ? static_cast( - new QDeclarativeCircleMapItemPrivateCPU(*this)) - : static_cast( - new QDeclarativeCircleMapItemPrivateOpenGL(*this))); - std::swap(m_d, d); - m_d->onGeoGeometryChanged(); - emit backendChanged(); -} - /*! \internal */ 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 ¢er); 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 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() @@ -477,46 +465,6 @@ QDeclarativeMapLineProperties *QDeclarativePolygonMapItem::border() return &m_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 d( - (m_backend == Software) ? static_cast( - new QDeclarativePolygonMapItemPrivateCPU(*this)) - : static_cast( - new QDeclarativePolygonMapItemPrivateOpenGL(*this))); - std::swap(m_d, d); - m_d->onGeoGeometryChanged(); - emit backendChanged(); -} - /*! \internal */ 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 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() @@ -1060,47 +1048,6 @@ QDeclarativeMapLineProperties *QDeclarativePolylineMapItem::line() return &m_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 d( - (m_backend == Software) - ? static_cast( - new QDeclarativePolylineMapItemPrivateCPU(*this)) - : static_cast( - new QDeclarativePolylineMapItemPrivateOpenGL(*this))); - m_d.swap(d); - m_d->onGeoGeometryChanged(); - emit backendChanged(); -} - /*! \internal */ 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 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,54 +143,12 @@ QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent) this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged); QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged, this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged); - setBackend(mapRectangleBackendSelector->backend); } 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 d( - (m_backend == Software) ? static_cast( - new QDeclarativeRectangleMapItemPrivateCPU(*this)) - : static_cast( - new QDeclarativeRectangleMapItemPrivateOpenGL(*this))); - - std::swap(m_d, d); - m_d->onGeoGeometryChanged(); - emit backendChanged(); -} - /*! \internal */ 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 m_d; diff --git a/tests/manual/mapitems_backends/main.qml b/tests/manual/mapitems_backends/main.qml index 56c4fda2..495462fe 100644 --- a/tests/manual/mapitems_backends/main.qml +++ b/tests/manual/mapitems_backends/main.qml @@ -178,19 +178,12 @@ Window { // border.color: "black" // border.width: 15 // objectName: parent.objectName + "limegreen" -// backend: polygonBackend() // path: [ // { longitude:17.13, latitude: 51.11}, // { longitude:30.54, latitude: 50.42}, // { longitude:26.70, latitude: 58.36}, // { longitude:17.13, latitude: 51.11} // ] - -// function polygonBackend() -// { -// return (switchPolygons1.checked) -// ? MapPolygon.OpenGL : MapPolygon.Software -// } // } layer { @@ -289,36 +282,13 @@ Window { property bool glCircles property bool glRectangles objectName: parent.objectName + "_MIG_" - function polylineBackend() - { - return (polyGroup.glPolylines) - ? MapPolyline.OpenGL : MapPolyline.Software - } - - function polygonBackend() - { - return (polyGroup.glPolygons) - ? MapPolygon.OpenGL : MapPolygon.Software - } - function rectangleBackend() - { - return (polyGroup.glRectangles) - ? MapRectangle.OpenGL : MapRectangle.Software - } - - function circleBackend() - { - return (polyGroup.glCircles) - ? MapCircle.OpenGL : MapCircle.Software - } MapPolyline { id: tstPolyLine // to verify the polygon stays where it's supposed to line.color: 'black' objectName: parent.objectName + "black" line.width: 1 opacity: 1.0 - backend: polylineBackend() path: [ { latitude: 76.9965, longitude: -175.012 }, { latitude: 26.9965, longitude: -175.012 } @@ -330,7 +300,6 @@ Window { line.color: "red" objectName: parent.objectName + "timeline" line.width: 4 - backend: polylineBackend() path: [ { latitude: 90, longitude: 180 }, { latitude: -90, longitude: -180 } @@ -341,7 +310,6 @@ Window { id: poly1 color: "red" objectName: parent.objectName + "red" - backend: polygonBackend() path: [ { latitude: 55, longitude: 170 }, { latitude: 66.9965, longitude: -175.012 }, @@ -365,7 +333,6 @@ Window { id: selfIntersectingPolygon color: 'darkmagenta' objectName: parent.objectName + "darkmagenta" - backend: polygonBackend() opacity: 1.0 path: [ { latitude: 19, longitude: 49 }, @@ -398,7 +365,6 @@ Window { border.color: "black" border.width: 8 objectName: parent.objectName + "green" - backend: polygonBackend() path: [ { latitude: -45, longitude: -170 }, { latitude: -55, longitude: -155 }, @@ -420,7 +386,6 @@ Window { id: poly3 color: "deepskyblue" objectName: parent.objectName + "deepskyblue" - backend: polygonBackend() opacity: 0.2 path: [ { latitude: 65, longitude: -20 }, @@ -436,7 +401,6 @@ Window { border.color: "black" border.width: 15 objectName: parent.objectName + "limegreen" - backend: polygonBackend() path: [ { longitude:17.13, latitude: 51.11}, { longitude:30.54, latitude: 50.42}, @@ -451,7 +415,6 @@ Window { border.color: "black" border.width: 8 objectName: parent.objectName + "yellow" - backend: polygonBackend() path: [ { longitude:4, latitude: 15}, { longitude:5, latitude: 15}, @@ -470,7 +433,6 @@ Window { border.width: 6 topLeft: QtPositioning.coordinate(10,-10) bottomRight: QtPositioning.coordinate(-10,10) - backend: rectangleBackend() MouseArea { anchors.fill: parent Rectangle { @@ -486,7 +448,6 @@ Window { id: longPolyline line.width: sliLineWidth.value line.color: 'firebrick' - backend: polylineBackend() } MapCircle { @@ -495,7 +456,6 @@ Window { color: 'deepskyblue' border.width: 6 border.color: 'firebrick' - backend: circleBackend() MouseArea { anchors.fill: parent Rectangle { @@ -511,12 +471,9 @@ Window { id: circle1 border.color: 'deepskyblue' border.width: 26 - backend: circleBackend() center: QtPositioning.coordinate(17, 44); radius: 200*1000 color: "firebrick" -// layer.enabled: (backend == MapCircle.Software) -// layer.samples: 4 } } } diff --git a/tests/manual/mapobjects_tester/main.qml b/tests/manual/mapobjects_tester/main.qml index 038f1e7a..52cdf36c 100644 --- a/tests/manual/mapobjects_tester/main.qml +++ b/tests/manual/mapobjects_tester/main.qml @@ -149,36 +149,12 @@ Window { property bool glRectangles objectName: parent.objectName + "_MIG_" - function polylineBackend() - { - return (polyGroup.glPolylines) - ? MapPolyline.OpenGL : MapPolyline.Software - } - - function polygonBackend() - { - return (polyGroup.glPolygons) - ? MapPolygon.OpenGL : MapPolygon.Software - } - - function rectangleBackend() - { - return (polyGroup.glRectangles) - ? MapRectangle.OpenGL : MapRectangle.Software - } - - function circleBackend() - { - return (polyGroup.glCircles) - ? MapCircle.OpenGL : MapCircle.Software - } MapPolyline { id: tstPolyLine // to verify the polygon stays where it's supposed to line.color: 'black' objectName: parent.objectName + "black" line.width: 1 opacity: 1.0 - backend: polylineBackend() path: [ { latitude: 76.9965, longitude: -175.012 }, { latitude: 26.9965, longitude: -175.012 } @@ -190,7 +166,6 @@ Window { line.color: "red" objectName: parent.objectName + "timeline" line.width: 4 - backend: polylineBackend() path: [ { latitude: 90, longitude: 180 }, { latitude: -90, longitude: -180 } @@ -201,7 +176,6 @@ Window { id: poly1 color: "red" objectName: parent.objectName + "red" - backend: polygonBackend() path: [ { latitude: 55, longitude: 170 }, { latitude: 66.9965, longitude: -175.012 }, @@ -225,7 +199,6 @@ Window { id: selfIntersectingPolygon color: 'darkmagenta' objectName: parent.objectName + "darkmagenta" - backend: polygonBackend() opacity: 1.0 path: [ { latitude: 19, longitude: 49 }, @@ -258,7 +231,6 @@ Window { border.color: "black" border.width: 8 objectName: parent.objectName + "green" - backend: polygonBackend() path: [ { latitude: -45, longitude: -170 }, { latitude: -55, longitude: -155 }, @@ -280,7 +252,6 @@ Window { id: poly3 color: "deepskyblue" objectName: parent.objectName + "deepskyblue" - backend: polygonBackend() opacity: 0.2 path: [ { latitude: 65, longitude: -20 }, @@ -297,7 +268,6 @@ Window { border.width: 6 topLeft: QtPositioning.coordinate(10,-10) bottomRight: QtPositioning.coordinate(-10,10) - backend: rectangleBackend() MouseArea { anchors.fill: parent Rectangle { @@ -311,7 +281,6 @@ Window { LongPolyline { id: longPoly - backend: polylineBackend() Component.onCompleted: longPolyPath = path } @@ -321,7 +290,6 @@ Window { color: 'deepskyblue' border.width: 6 border.color: 'firebrick' - backend: circleBackend() MouseArea { anchors.fill: parent Rectangle { @@ -337,12 +305,9 @@ Window { id: circle1 border.color: 'deepskyblue' border.width: 26 - backend: circleBackend() center: QtPositioning.coordinate(17, 44); radius: 200*1000 color: "firebrick" -// layer.enabled: (backend == MapCircle.Software) -// layer.samples: 4 } } } diff --git a/tests/manual/mappolyline_tester/main.qml b/tests/manual/mappolyline_tester/main.qml index c8154916..25ec1f55 100644 --- a/tests/manual/mappolyline_tester/main.qml +++ b/tests/manual/mappolyline_tester/main.qml @@ -176,25 +176,12 @@ Window { property bool glRectangles : true objectName: parent.objectName + "_MIG_" - function polylineBackend() - { - return (polyGroup.glPolylines === "Software") - ? MapPolyline.Software : MapPolyline.OpenGL - } - - function polygonBackend() - { - return (polyGroup.glPolylines === "Software") - ? MapPolygon.Software : MapPolygon.OpenGL - } - MapPolyline { id: tstPolyLine // to verify the polygon stays where it's supposed to line.color: 'black' objectName: parent.objectName + "black" line.width: 1 opacity: 1.0 - backend: polylineBackend() path: [ { latitude: 76.9965, longitude: -175.012 }, { latitude: 26.9965, longitude: -175.012 } @@ -206,7 +193,6 @@ Window { line.color: "red" objectName: parent.objectName + "timeline" line.width: 4 - backend: polylineBackend() path: [ { latitude: 90, longitude: 180 }, { latitude: -90, longitude: -180 } @@ -218,7 +204,6 @@ Window { line.color: "pink" line.width: sliWidth.value objectName: parent.objectName + "red" - backend: polylineBackend() path: [ { latitude: 55, longitude: 170 }, @@ -248,7 +233,6 @@ Window { border.color: "black" border.width: 12 objectName: parent.objectName + "green" - backend: polygonBackend() path: [ { latitude: -45, longitude: -170 }, { latitude: -55, longitude: -155 }, @@ -265,13 +249,6 @@ Window { } } } - -// LongPolyline { -// id: longPolyline -// line.width: 10 -// line.color: 'firebrick' -// backend: polylineBackend() -// } } } -- cgit v1.2.1