QWebEngine crashes with WebGL content
-
wrote on 30 Nov 2023, 09:31 last edited by Pythonic person
hi, am trying to open my unity WebGL game with pyqt5 by using QWebEngine, any way the game works correctly with google chrome (localhost game) but whoever I tried to open the same game using QWbEngine, my application (pyqt5) crahses with following error:
Windows fatal exception: access violation
Process finished with exit code -1073741819 (0xC0000005)here is the following code which amk using:
from PyQt5.QtWidgets import QApplication, QMainWindow from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings from PyQt5.QtCore import QUrl class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.browser = QWebEngineView() # Enable WebGL in QWebEngineSettings settings = QWebEngineSettings.globalSettings() settings.setAttribute(QWebEngineSettings.WebGLEnabled, True) try: self.browser.setUrl(QUrl('http://localhost:7898/')) except Exception as e: print(e) self.setCentralWidget(self.browser) if __name__ == "__main__": app = QApplication([]) QApplication.setApplicationName("Python PyQt5 Web Browser") window = MainWindow() window.show() app.exec_()
NOTE: the game am trying to render is an empty 3D scene so it's not a complex 3d scene at all.
-
Hi,
You should contact the PyQt folks on their forum as they will have better insight for that question.
1/2