From b53896d1e7f3cad971edd56f303a32058cefde48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@qt.io>
Date: Wed, 26 Apr 2017 11:43:22 +0200
Subject: [PATCH] Detect the scenegraph software backend when it was set
 programatically

Since 5.8, it is possible to set the Qt Quick scenegraph backend using
QQuickWindow::setSceneGraph backend. However, this is not detectable by
WebEngine's implementation as it relied on environment variables or
command line options being specified.

Task-number: QTBUG-60232
Change-Id: I53291510887ec5c75a15d5927a84e91fb5859e26
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
---
 src/core/web_engine_context.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 81f968d11..60622b4ae 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())
-- 
GitLab