Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

enabled Web3Gl



  • hello,
    I have to use a graphics library in my project with QML / QWebEngine.
    I set and tested the WebGL enablement.
    Usage VS2017 / Windows is QT 5.11
    I have performed the following steps
    In the QML file

    import QtWebEngine 1.6
            WebEngineView {
                id: viewEnginePgm
                settings.webGLEnabled: true
    

    At the opening of the application

    QCoreApplication :: setAttribute (Qt :: AA_UseDesktopOpenGL);
    QCoreApplication :: setAttribute (Qt :: AA_UseSoftwareOpenGL);
    

    In the .pro file

    LIBS + = opengl32.lib
    

    The result is always the same.
    Does anyone have an idea to solve it?
    Thanks

    0_1559821677916_testwebgl.PNG



  • Install QT version 5.14.0 and make only this into main.cpp

    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    
    	bool ret;
    	ret = qputenv("QTWEBENGINE_CHROMIUM_FLAGS", " --ignore-gpu-blacklist --enable-gpu-rasterization --enable-oop-rasterization --use-angle");
    /* this only for print into console.log */
    	ret = qputenv("QSG_INFO", "1");
    	ret = qputenv("QT_OPENGL", "angle");
    	ret = qputenv("QT_ANGLE_PLATFORM", "d3d11");
    	ret = qputenv("QSG_RENDER_LOOP", "basic");
    
    	QApplication::setAttribute(Qt::AA_UseOpenGLES);
    	QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
    	QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);
    
    	QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
    	QGuiApplication app(argc, argv);
    

Log in to reply