PyQt5 QWebEngineView does not show webpage

Jean-Baptiste Peter jbpeter at outlook.com
Fri Sep 16 10:03:17 BST 2022


Hi,

I wrote small script which creates a qwebengineview in a qdialog. When I run it, there is a white flash and then the dialog looks completely empty. The webengineview seems to be initialized as it is possible to call its methods such as .url().

I found a few post describing a similar issue but didn't find any solution as of now:

https://stackoverflow.com/questions/55252584/pyqt5-qwebengineview-window-wont-show
https://stackoverflow.com/questions/72346850/pyqt5-qwebengineview-does-not-show-webpage
https://stackoverflow.com/questions/72131093/pyqt5-qwebengineview-doesnt-load-url
https://stackoverflow.com/questions/70988870/unable-to-render-webpage-using-qwebengineview


Here is my script :

from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5 import QtWidgets
from PyQt5.QtCore import QUrl
dlg = QtWidgets.QDialog()
view = QWebEngineView()
layout = QtWidgets.QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(view)
dlg.setLayout(layout)
url = QUrl("https://www.whatsmybrowser.org/")
view.load(url)
dlg.show()

My configuration:
Windows 11
PyQt5 5.15.4
PyQt5-sip 12.9.0
PyQtWebEngine 5.15.5


Do you have any idea what could be the problem? Thank you,

Best,


--
Jean-Baptiste PETER

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220916/7aaae1e9/attachment.htm>


More information about the PyQt mailing list