summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-01-11 16:02:14 +0100
committerIvan Solovev <ivan.solovev@qt.io>2021-03-25 11:08:33 +0100
commit4bcacd0dc8f73de7b9e5e5f5fa2129fd88bdff3b (patch)
treec257958bf7892f83fa6a80331c53c8292293b2f2 /src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
parent4d6e3ba98a09ffb390da90154a2f61085b565d8e (diff)
downloadqtlocation-4bcacd0dc8f73de7b9e5e5f5fa2129fd88bdff3b.tar.gz
Fix compilation for no opengl builds
Disables experimental labs qml plugin, which since a4469cad40 depends heavily on opengl backend. Fix warnings with msvc when compiling without experimental plugin. Task-number: QTBUG-91623 Fixes: QTBUG-88017 Change-Id: I53c5da915981bd05f39134ba57f585d0a0786aa8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativerectanglemapitem.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativerectanglemapitem.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
index 74d2cc13..6192be08 100644
--- a/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativerectanglemapitem.cpp
@@ -185,9 +185,18 @@ void QDeclarativeRectangleMapItem::setBackend(QDeclarativeRectangleMapItem::Back
if (b == m_backend)
return;
m_backend = b;
- QScopedPointer<QDeclarativeRectangleMapItemPrivate> d((m_backend == Software)
- ? static_cast<QDeclarativeRectangleMapItemPrivate *>(new QDeclarativeRectangleMapItemPrivateCPU(*this))
- : static_cast<QDeclarativeRectangleMapItemPrivate * >(new QDeclarativeRectangleMapItemPrivateOpenGL(*this)));
+ QScopedPointer<QDeclarativeRectangleMapItemPrivate> d(
+ (m_backend == Software) ? static_cast<QDeclarativeRectangleMapItemPrivate *>(
+ new QDeclarativeRectangleMapItemPrivateCPU(*this))
+#if QT_CONFIG(opengl)
+ : static_cast<QDeclarativeRectangleMapItemPrivate *>(
+ new QDeclarativeRectangleMapItemPrivateOpenGL(*this)));
+#else
+ : nullptr);
+ qFatal("Requested non software rendering backend, but source code is compiled wihtout opengl "
+ "support");
+#endif
+
m_d.swap(d);
m_d->onGeoGeometryChanged();
emit backendChanged();
@@ -397,6 +406,8 @@ QDeclarativeRectangleMapItemPrivate::~QDeclarativeRectangleMapItemPrivate() {}
QDeclarativeRectangleMapItemPrivateCPU::~QDeclarativeRectangleMapItemPrivateCPU() {}
+#if QT_CONFIG(opengl)
QDeclarativeRectangleMapItemPrivateOpenGL::~QDeclarativeRectangleMapItemPrivateOpenGL() {}
+#endif
QT_END_NAMESPACE