From 4bcacd0dc8f73de7b9e5e5f5fa2129fd88bdff3b Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 11 Jan 2021 16:02:14 +0100 Subject: 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 --- .../declarativemaps/qdeclarativerectanglemapitem.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/location/declarativemaps/qdeclarativerectanglemapitem.cpp') 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 d((m_backend == Software) - ? static_cast(new QDeclarativeRectangleMapItemPrivateCPU(*this)) - : static_cast(new QDeclarativeRectangleMapItemPrivateOpenGL(*this))); + QScopedPointer d( + (m_backend == Software) ? static_cast( + new QDeclarativeRectangleMapItemPrivateCPU(*this)) +#if QT_CONFIG(opengl) + : static_cast( + 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 -- cgit v1.2.1