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. How can I enable WebGL in QWebEngine 5.9 under Windows?
Forum Updated to NodeBB v4.3 + New Features

How can I enable WebGL in QWebEngine 5.9 under Windows?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 978 Views
  • 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.
  • kitekatK Offline
    kitekatK Offline
    kitekat
    wrote on last edited by
    #1

    I want to use WebGL in QtWebEngineWidgets.QWebEngineView under Windows with my Qt 5.9.2.

    But when I try to load webglreport.com, in QWebEngineView it tells me, that "This browser supports WebGL 2, but it is disabled or unavailable."

    How can I fix it?

    Here's my code:

    PyQt:

    import os, sys
    from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
    
    
    if __name__ == '__main__':
        app = QtWidgets.QApplication(sys.argv)
    
    
       # app.setAttribute(QtCore.Qt.AA_UseOpenGLES)  # nothing happens, you can comment it out
    
        view = QtWebEngineWidgets.QWebEngineView()
    
        # view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True) # does not help too = (((
    
        view.load(QtCore.QUrl("http://webglreport.com/?v=2"))
    
        view.show()
    
        sys.exit(app.exec_())
    
        # And here WebGL Report  will tell me: "This browser supports WebGL 2, but it is disabled or unavailable."
        # How can I cope with it???
    

    C++ Qt:

    #include <QApplication>
    #include <QtWebEngineWidgets/QWebEngineView>
    
    #include <QUrl>
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QWebEngineView view;
        view.load(QUrl("http://webglreport.com/"));
        view.show();
        return a.exec();
    }
    
    1 Reply Last reply
    1

    • Login

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