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
commite03d85dcb8769166aaeacd639b652f52b37d0cdd (patch)
tree7b3fd85b286ad9a85c3b7ba4b9cf167428b442e1
parenta3f02bf9d41d0954df1c393be382c73cf5d8a8e5 (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 e16f9c727..3c2eefdf5 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -197,7 +197,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 "