Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.0
-
9e5214e617 (qt/qtwebengine/dev) 9e5214e617 (qt/tqtc-qtwebengine/dev) e03d85dcb8 (qt/qtwebengine/6.4) 2d0926b587 (qt/qtwebengine/6.3) 2d0926b587 (qt/tqtc-qtwebengine/6.3) e03d85dcb8 (qt/tqtc-qtwebengine/6.4) e03d85dcb8 (qt/tqtc-qtwebengine/6.4.1)
Description
Running the Minibrowser example (https://doc.qt.io/qt-6/qtwebview-minibrowser-example.html ) produces this message:
Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute and QSGRendererInterface::OpenGLRhi using QQuickWindow::setGraphicsApi before constructing QGuiApplication.
However, the message persists even after modifying the example:
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); QtWebView::initialize(); QGuiApplication app(argc, argv); ...
The way Qt is starting up in the QGuiApplication/QCoreApplication constructors and with the plugin architectures means that initialize() in qtwebenginecoreglobal.cpp is run before anything has actually given Qt a chance to create the shared OpenGL context, so although the attribute is set, qt_gl_global_share_context() still returns null.
Is it safe to simply ignore this warning? The application seems to run without ill effects.