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();
}
Felix
  • 3,351
  • 6
  • 40
  • 68
  • 1
    Do you use OpenGL or ANGLE in your Qt build? – Jaa-c Jul 25 '18 at 11:15
  • Well... I don't know. How to check it? – Felix Jul 25 '18 at 12:00
  • Are you sure the problem lies with `QWebEngineView`? What happens if you try to load `http://webglreport.com/?v=2` in your normal browser (firefox, chrome or whatever)? – G.M. Jul 25 '18 at 12:12
  • Well, of course, I loaded http://webglreport.com/?v=2 in normal browser (Google Chrome) and it was successful (it told me that it supports WebGL 2). And I've even tried to load it in Qt 5.10 and it succeeded too. Alas, I want to enable WebGL in Qt 5.9 LTS (because I have it in my OSGeo4W package). – Felix Jul 25 '18 at 13:38

1 Answers1

1

Binary Packages

Wheels are provided for Python v3.5 and later for 64-bit Linux, macOS and 32-bit and 64-bit Windows. These include copies of the corresponding Qt libraries.

Note that the minimum version of macOS supported is determined by the version of Qt included in the wheel.

Note that for v5.11 and later the 32-bit Windows wheels do not contain the WebEngine modules. pyqt download

mischva11
  • 2,811
  • 3
  • 18
  • 34
DonMazay
  • 11
  • 1