Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103958

Unable to remove warning, "Qt WebEngine seems to be initialized from a plugin..."

    XMLWordPrintable

    Details

    • Commits:
      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.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            mibrunin Michael Bruning
            Reporter:
            skoh-qt Sze Howe Koh
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes