[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Fixed: Error message on import of QWebEngineView
From:       David Cortesi <davecortesi () gmail ! com>
Date:       2022-10-17 17:31:22
Message-ID: CALyzANsX0nTiQjUHOsO+h+4H9q59jm=6YW_bAwBj9VTh_hogpA () mail ! gmail ! com
[Download RAW message or body]

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@gmail.com>
wrote:

> 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?
>
>

[Attachment #3 (text/html)]

<div dir="ltr"><div>In re this and related messages when creating a QtWebEngineView, \
I made the errors go away as follows.</div><div><br></div><div>In my root module, \
before I create the Application, I added the single line,</div><div>         import \
PyQt6.QtWebEngineWidgets</div><div><br></div><div>That module doesn&#39;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.</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Thu, Oct 13, 2022 at 10:55 AM David Cortesi &lt;<a \
href="mailto:davecortesi@gmail.com">davecortesi@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div \
dir="ltr"><div>When my code, long subsequent to creating the QApplication and a main \
window, hits this statement,</div><div><br></div><div>       from \
PyQt6.QtWebEngineWidgets import QWebEngineView</div><div><br></div><div>the following \
error message appears,</div><div><br></div><div>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.</div><div><br></div><div>I could do the first thing at the time I \
create the QApplication, but I never have cause to import QQuickWindow and don&#39;t \
want to.</div><div><br></div><div>Can anybody shed light on what this is \
about?</div><div><br></div></div> </blockquote></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic