diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp index a11da2d543..1e533f87dc 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp @@ -88,6 +88,7 @@ bool QOffscreenX11Integration::hasCapability(QPlatformIntegration::Capability ca } } +#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin) QPlatformOpenGLContext *QOffscreenX11Integration::createPlatformOpenGLContext(QOpenGLContext *context) const { auto &connection = nativeInterface()->m_connection; @@ -100,6 +101,7 @@ QPlatformOpenGLContext *QOffscreenX11Integration::createPlatformOpenGLContext(QO return new QOffscreenX11GLXContext(connection->x11Info(), context); } +#endif // !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin) QOffscreenX11PlatformNativeInterface *QOffscreenX11Integration::nativeInterface() const { @@ -121,7 +123,7 @@ void *QOffscreenX11PlatformNativeInterface::nativeResourceForScreen(const QByteA return nullptr; } -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin) void *QOffscreenX11PlatformNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { if (resource.toLower() == QByteArrayLiteral("glxconfig") ) { if (context) { @@ -164,6 +166,7 @@ QOffscreenX11Info *QOffscreenX11Connection::x11Info() return m_x11Info.data(); } +#if QT_CONFIG(xcb_glx_plugin) class QOffscreenX11GLXContextData { public: @@ -311,5 +314,5 @@ void *QOffscreenX11GLXContext::glxConfig() const { return d->config; } - +#endif // QT_CONFIG(xcb_glx_plugin) QT_END_NAMESPACE diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h index ed4b83c0a4..7e26b76759 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h @@ -59,7 +59,7 @@ public: ~QOffscreenX11PlatformNativeInterface(); void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; -#ifndef QT_NO_OPENGL +#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin) void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override; #endif @@ -72,7 +72,9 @@ public: ~QOffscreenX11Integration(); bool hasCapability(QPlatformIntegration::Capability cap) const override; +#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin) QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; +#endif QOffscreenX11PlatformNativeInterface *nativeInterface() const override; }; @@ -93,6 +95,7 @@ private: QScopedPointer m_x11Info; }; +#if QT_CONFIG(xcb_glx_plugin) class QOffscreenX11GLXContextData; class QOffscreenX11GLXContext : public QPlatformOpenGLContext @@ -119,6 +122,7 @@ public: private: QScopedPointer d; }; +#endif // QT_CONFIG(xcb_glx_plugin) QT_END_NAMESPACE