diff options
Diffstat (limited to 'src/location/declarativemaps/qdeclarativerectanglemapitem.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativerectanglemapitem.cpp | 17 |
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 |