summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2022-10-17 17:25:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-18 10:50:00 +0000
commit2d0926b587cbf32941973f3e506b1c6de74316d8 (patch)
tree64cb1af68ee944a063af836d7c5e28edfafce214
parent26ebdc62a6ec4dd59f873e86afd4531f2c2f3546 (diff)
Only warn the user about conditions that are not met
When loaded from a plugin, we printed a warning about setting the application attribute Qt::AA_ShareOpenGLContexts and choosing OpenGLRhi as the scene graph renderer interface even when those conditions were already met. This patch checks if these conditions are already met before printing the warning. Change-Id: Iee06fa4560e022f0611f07a082513dc91c8065c9 Fixes: QTBUG-103958 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 9e5214e617471b326cc975095054f859924b4168) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 5215f7ce7..fc4e23963 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -233,7 +233,10 @@ static void initialize()
#if QT_CONFIG(opengl)
if (QCoreApplication::instance()) {
// On window/ANGLE, calling QtWebEngineQuick::initialize from DllMain will result in a crash.
- if (!qt_gl_global_share_context()) {
+ if (!qt_gl_global_share_context() &&
+ !(QCoreApplication::testAttribute(Qt::AA_ShareOpenGLContexts) &&
+ QQuickWindow::graphicsApi() == QSGRendererInterface::OpenGLRhi)
+ ) {
qWarning("Qt WebEngine seems to be initialized from a plugin. Please "
"set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute and "
"QSGRendererInterface::OpenGLRhi using QQuickWindow::setGraphicsApi "