Fixed: Error message on import of QWebEngineView

David Cortesi davecortesi at
Mon Oct 17 18:31:22 BST 2022

In re this and related messages when creating a QtWebEngineView, I made the
errors go away as follows.

In my root module, before I create the Application, I added the single line,
     import PyQt6.QtWebEngineWidgets

That module doesn't use WebEngine, in fact the WebEngineView is first
instantiated much later when the user does something. But having this
import before the Application starts prevents the error message later.

On Thu, Oct 13, 2022 at 10:55 AM David Cortesi <davecortesi at>

> When my code, long subsequent to creating the QApplication and a main
> window, hits this statement,
>     from PyQt6.QtWebEngineWidgets import QWebEngineView
> the following error message appears,
> 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.
> I could do the first thing at the time I create the QApplication, but I
> never have cause to import QQuickWindow and don't want to.
> Can anybody shed light on what this is about?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the PyQt mailing list