In a tiny toy program, if I imported QtWebEngineWidgets after creating the 
app and main window then the error was reproduced.  If I imported it before 
creating the App or main window, then the import succeeded, 
and QWebEngineView was available.

On Sunday, February 13, 2022 at 11:45:56 PM UTC-5 tbp1...@gmail.com wrote:

> Does anyone know how to import QtWebEngineWidgets with PyQt6?  As of 
> version 6.23, this module exists, and I can import it (along with it 
> QWebEngineView) in a standalone console that has not created a Qt Gui.
>
> But when I try to import it in a script running in Leo, it fails:
>
> from PyQt6 import QtWebEngineWidgets
> exception executing script
> ImportError: QtWebEngineWidgets must be imported before a QCoreApplication 
> instance is created
>
> Does this mean that Leo will need to import QtWebEngineWidgets before 
> building its Qt GUI?  Has anyone here devised some way to get the import to 
> work? I haven't found anything with on-line searches so far except that it 
> isn't practical for a running application.
>
> Otherwise, I can't see a way to import QWebEngineView in pyqt6, and it's 
> needed for VR3 among others.
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/bfb4e698-ad75-4c9d-ad63-2ffda58877d9n%40googlegroups.com.

Reply via email to