diff options
Diffstat (limited to 'src/webenginequick/api/qtwebenginequickglobal.cpp')
-rw-r--r-- | src/webenginequick/api/qtwebenginequickglobal.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/webenginequick/api/qtwebenginequickglobal.cpp b/src/webenginequick/api/qtwebenginequickglobal.cpp index 607777e55..b16305dae 100644 --- a/src/webenginequick/api/qtwebenginequickglobal.cpp +++ b/src/webenginequick/api/qtwebenginequickglobal.cpp @@ -43,9 +43,12 @@ void initialize() QtWebEngineCore::initialize(); return; } + // call initialize the same way as widgets do qAddPreRoutine(QtWebEngineCore::initialize); - QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); + auto api = QQuickWindow::graphicsApi(); + if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi) + QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); } } // namespace QtWebEngineQuick |