Important: Please read the Qt Code of Conduct -

OpenGL 4.4 Context

  • Hi,

    I'm trying to integrate my opengl renderer with a qml (windows desktop) application.
    My current setup is VS 2013 (with qt plugin) and Qt 5.6. Qt was installed using the maintenance tool. Before there was an option to choose between qt_opengl and qt_angle, for 5.6 i don't see that option anymore (maybe important info, i don't know). I have a AMD firepro M4100 FireGL which supports OpenGL up to 4.4 (according to OpenGL extension viewer)
    As a guide to integrate my renderer, i used the Squircle example. Everything works ok (The area i want in my qml app uses the renderer to render it's content), i only fail to get the correct context (version) for my renderer. The renderer expects OpenGL 4.x, but i only seem to be able to get an OpenGL ES (3.0) context.
    The things I tried (but failed):

    1. At the start of my app, i did:
    QSurfaceFormat format;
    format.setVersion(4, 4);
    1. My "MainWindow" is a QML Window element and I use a QQmlApplicationEngine to load the main file. After _engine->load(...) i did:
    QQuickWindow* w = (QQuickWindow*)_engine->rootObjects().first();
    		format.setVersion(4, 4);

    I get in debug an error that this version of the openglcontext cannot be created and i should install drivers which can create it, or put some dlls (d3dcompiler, libglesv and libegl) next to my application ((this last one doesn't make a difference).

    I also tried to get the OpenGL ES 3.3 context (by changing the numbers in the above function) Then when i use the window() method from the qquickitem that i positioned in my app, to get the opengl context, and when i ask in my renderer

    int minor = m_window->openglContext()->format().minorVersion();
    int major = m_window->openglContext()->format().majorVersion();
    bool es = m_window->openglContext()->isOpenGLES();

    i get OpenGLES 3.0. I'm clueless on how to tell the qml app to use OpenGL 4.4. Anybody has an idea?


  • When I downgrade to Qt 5.5, it works like expected (5.6 and 5.7 don't). Probably something to do with the default installation of Qt (using angle)?


  • As found here:, if i set QT_OPENGL env, variable to desktop, it works!


Log in to reply