diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index d9bf82e4f98571fc90413a1f32ffc3fdfa715f12..aa5a1cea8b2f21aa9df313325f52d8d4907ae8fb 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -175,12 +175,14 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons
     return new QWaylandShmWindow(window);
 }
 
+#ifndef QT_NO_OPENGL
 QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
 {
     if (mDisplay->clientBufferIntegration())
         return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle());
     return 0;
 }
+#endif // QT_NO_OPENGL
 
 QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *window) const
 {
diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h
index bbe982853896f96da5ae936c4f461680f71b0167..699702482db233afda158fbdfd1e022818823643 100644
--- a/src/client/qwaylandintegration_p.h
+++ b/src/client/qwaylandintegration_p.h
@@ -61,7 +61,9 @@ public:
 
     bool hasCapability(QPlatformIntegration::Capability cap) const;
     QPlatformWindow *createPlatformWindow(QWindow *window) const;
+#ifndef QT_NO_OPENGL
     QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
+#endif
     QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
 
     QAbstractEventDispatcher *createEventDispatcher() const;
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index 332ea9265d5f7686be710fab3adfbae77c1b18a2..d407335d3f75bff020b68bbedd509def97d44542 100644
--- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/qwaylandshmbackingstore.cpp
@@ -323,6 +323,7 @@ QWaylandWindow *QWaylandShmBackingStore::waylandWindow() const
     return static_cast<QWaylandWindow *>(window()->handle());
 }
 
+#ifndef QT_NO_OPENGL
 QImage QWaylandShmBackingStore::toImage() const
 {
     // Invoked from QPlatformBackingStore::composeAndFlush() that is called
@@ -331,6 +332,7 @@ QImage QWaylandShmBackingStore::toImage() const
 
     return *contentSurface();
 }
+#endif // QT_NO_OPENGL
 
 void QWaylandShmBackingStore::done(void *data, wl_callback *callback, uint32_t time)
 {
diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h
index 319acd9a9820d79aeb554d87b2bd7772db3cb9b7..1212e52fe3391ba1c51d2966fe819905a6bb3252 100644
--- a/src/client/qwaylandshmbackingstore_p.h
+++ b/src/client/qwaylandshmbackingstore_p.h
@@ -94,7 +94,9 @@ public:
     QWaylandWindow *waylandWindow() const;
     void iterateBuffer();
 
+#ifndef QT_NO_OPENGL
     QImage toImage() const Q_DECL_OVERRIDE;
+#endif
 
 private:
     void updateDecorations();