diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-06 15:18:06 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-06 16:30:14 +0200 |
commit | 678076faeabd7e827abe31f72f4220af8d8f95ac (patch) | |
tree | 47659878276e369d3b07075d24861a795dc564b2 /src/webengine/api/qtwebengineglobal.cpp | |
parent | 08203aef3ab102bfb91928f37846b2b19a4540ee (diff) | |
download | qtwebengine-678076faeabd7e827abe31f72f4220af8d8f95ac.tar.gz |
Select opengl RHI backend while we still use QQuickWidget
QQuickWidget depends on using the OpenGL backend.
Change-Id: I3679e90723930b3fd627a0ce03935dcca0372212
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/webengine/api/qtwebengineglobal.cpp')
-rw-r--r-- | src/webengine/api/qtwebengineglobal.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp index 4346832c9..825805888 100644 --- a/src/webengine/api/qtwebengineglobal.cpp +++ b/src/webengine/api/qtwebengineglobal.cpp @@ -39,6 +39,7 @@ #include "qtwebengineglobal.h" #include <QCoreApplication> +#include <QQuickWindow> namespace QtWebEngineCore { @@ -72,15 +73,16 @@ namespace QtWebEngine { */ void initialize() { - QCoreApplication *app = QCoreApplication::instance(); - if (app) { + QCoreApplication *app = QCoreApplication::instance(); + if (app) { qWarning("QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. "\ "This is depreciated and may fail in the future."); QtWebEngineCore::initialize(); return; - } - // call initialize the same way as widgets do - qAddPreRoutine(QtWebEngineCore::initialize); + } + // call initialize the same way as widgets do + qAddPreRoutine(QtWebEngineCore::initialize); + QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); } } // namespace QtWebEngine |