summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp12
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp2
2 files changed, 9 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
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
index 5949f3d6e..76f422e9d 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
@@ -41,6 +41,7 @@
#include <QCoreApplication>
#include <QOpenGLContext>
+#include <QQuickWindow>
namespace QtWebEngineCore
{
@@ -67,6 +68,7 @@ static void initialize()
}
//QCoreApplication is not yet instantiated, ensuring the call will be deferred
qAddPreRoutine(QtWebEngineCore::initialize);
+ QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
#endif // QT_CONFIG(opengl)
}