Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngine crashes with WebGL content
Forum Updated to NodeBB v4.3 + New Features

QWebEngine crashes with WebGL content

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 2 Posters 305 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pythonic person
    wrote on 30 Nov 2023, 09:31 last edited by Pythonic person
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Nov 2023, 21:22 last edited by
      #2

      Hi,

      You should contact the PyQt folks on their forum as they will have better insight for that question.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      30 Nov 2023, 09:31

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved