Hi,

Following up on my previous post, I managed to get qwebengine to work within a 
plugin on windows 10.

I had to do the following changes :

- On QGIS side, I had to change a line in the main.cpp from core to set 
"Qt::AA_ShareOpenGLContexts". I already posted a PR for this :
https://github.com/qgis/QGIS/pull/47873

- I had to upgrade manually one of the dependency (python3-pyqt5-sip) to avoid 
the following error : “RuntimeError: the sip module implements API v12.0 to 
v12.8 but the PyQt5.QtCore module requires API v12.9”

- Finally, on Pyqt side it was necessary to add an additional check during 
initialization to detect if "Qt::AA_ShareOpenGLContexts" has been set; I 
already reported the issue and this should be addressed in the next release.

After doing these modifications, it works as expected in my environment. Would 
it be possible to apply these fixes in master?

Best,

Jean-Baptiste Peter


----Original Message-----
From: Nyall Dawson <nyall.daw...@gmail.com>
Sent: Wednesday, February 16, 2022 1:57 AM
To: Jean-Baptiste Peter <jbpe...@outlook.com>
Cc: qgis-developer@lists.osgeo.org
Subject: Re: [QGIS-Developer] Recommended method to display a webpage in a 
plugin

On Wed, 16 Feb 2022 at 06:46, Jean-Baptiste Peter <jbpe...@outlook.com> wrote:
>
> Hello,
>
> I am trying to figure what is the right way to display a webpage within a 
> QGIS plugin and I have a few questions :
>
> Is it currently possible to use QWebEngineView class with QGIS python 
> console? When I try to import it in QGIS python console, I get the following 
> error :
>
>
>
> ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
>
>
>
>
>
> 2. If it is not currently possible to use QWebEngineView, does it involve 
> major work or is there a chance it will be supported in the near future?

It's a very messy, horrible situation with no good ways forward. Right now 
you'll need to use QtWebKit, and there's no plans on the horizon to change this.

Nyall

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to