<div dir="auto">Hi Enrico, have you tried to import early the qwebengine before the other modules?<div dir="auto"><br></div><div dir="auto">Like that example:</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage</div><div dir="auto">from qgis.PyQt.QtCore import QCoreApplication, QObject</div><div dir="auto">from qgis.PyQt.QtWidgets import QAction</div><div dir="auto">from qgis.core import QgsApplication</div><div dir="auto">from qgis.gui import QgsMapCanvas</div><div dir="auto"><br></div><div dir="auto">class MyPlugin(QObject):</div><div dir="auto">    def __init__(self, iface):</div><div dir="auto">        super().__init__()</div><div dir="auto">        self.iface = iface</div><div dir="auto">        self.web_view = QWebEngineView()</div><div dir="auto">        self.web_view.setPage(QWebEnginePage())</div><div dir="auto">        self.initGui()</div><div dir="auto"><br></div><div dir="auto">I fixed the same problem in this way but I use windows not Linux </div><div dir="auto"><br></div><div dir="auto">Best</div><div dir="auto">E</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il dom 26 mag 2024, 10:42 Enrico Ferreguti via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear QGIS developers, I would need your support to update my plugins.<br></div><div><br></div><div>I read that Qt WebEngine, from QGIS 

<p style="margin:0px;text-indent:0px;white-space:pre-wrap">3.36.3-Maidenhead, QT 5.15.3, <span style="white-space:normal">is available for plugins: <a href="https://changelog.qgis.org/en/entry/2607" target="_blank" rel="noreferrer">https://changelog.qgis.org/en/entry/2607</a></span></p></div><div><br></div><div>But on Ubuntu Jammy LTS 22.04 and a fresh QGIS 3.36.3-Maidenhead with QT 5.15.3, when I try to import from QT5:</div><div>from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage, <br><br></div><div>I get an exception:</div><div>ImportError: QtWebEngineWidgets must be imported before a QCoreApplication instance is created</div><div><br></div><div>and when I do the same from python3 in bash I get no exceptions<br></div><div><br></div><div>Where Am I wrong? Is there something different to do for importing QtWebEngineWidgets ?</div><div>Can you point me to a running example?</div><div><br></div><div>Thank you very much.<br></div><div>Enrico Ferreguti<br></div><div><br></div><div><br></div></div>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>