PySide2 - QtWebEngine dont display anything (blank screen inside QWebEngineView) / Ubuntu 22.04 Mate - kernel 5.15.0-46 - Python 3.10
-
Hi guys, i got an issue using QtWebEngine under linux => nothing appear into the QWebEngineView (working pretty well under Windows 10
Here my config:
Linux Ubuntu Mate 22.04
Linux kernel 5.15.0-46
Python 3.10
PySide2 5.15.2.1 (also try with 5.13.2/5.13.1/5.13.0)Here the code:
import sys import os from pathlib import Path from PySide2.QtWidgets import QApplication, QMainWindow from PySide2.QtCore import QFile from PySide2.QtUiTools import QUiLoader from PySide2.QtWebEngineWidgets import * class Trader(QMainWindow): def __init__(self, parent): super(Trader, self).__init__() self.parent = parent loader = QUiLoader() path = os.fspath(Path(__file__).resolve().parent / "form.ui") ui_file = QFile(path) ui_file.open(QFile.ReadOnly) self.ui = loader.load(ui_file, self) ui_file.close() self.web = QWebEngineView() print(self.web.load("https://www.google.fr")) self.ui.view_layout.addWidget(self.web) self.showMaximized() if __name__ == "__main__": app = QApplication([]) widget = Trader(app) sys.exit(app.exec_())
-
i justed try:
- http / https had same issue
with checking the signals i can figure out that
-
the signal renderProcessTerminated is emit right after initialisation of QWebEngineView object with:
status = PySide2.QtWebEngineWidgets.QWebEnginePage.RenderProcessTerminationStatus.CrashedTerminationStatus
exit code = 159 -
then i use QWebEngineView.load(url) method
-loadStarted is emit
-loadProgress(1) is emited -
the signal renderProcessTerminated is emit right after initialisation of QWebEngineView object with:
status = PySide2.QtWebEngineWidgets.QWebEnginePage.RenderProcessTerminationStatus.CrashedTerminationStatus
exit code = 159
-loadProgress(100) is emited