diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 81f968d115388cd6266fd8a0536df12d1f2abc2e..60622b4ae6fd25368202366dc59df96ca75d7a02 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -91,6 +91,7 @@
 #ifndef QT_NO_OPENGL
 # include <QOpenGLContext>
 #endif
+#include <QQuickWindow>
 #include <QStringList>
 #include <QSurfaceFormat>
 #include <QVector>
@@ -157,6 +158,8 @@ bool usingQtQuick2DRenderer()
         }
     }
 
+    if (device.isEmpty())
+        device = QQuickWindow::sceneGraphBackend();
     if (device.isEmpty())
         device = QString::fromLocal8Bit(qgetenv("QT_QUICK_BACKEND"));
     if (device.isEmpty())