Important: Please read the Qt Code of Conduct -

Efficiency of QGLWidget

  • Hi folks!

    I'm currently in the planning stages of a OpenGL 3.3 (Core) based 3D engine, which is the topic of my diploma thesis in computer science. Since QGLWidget is so incredibly easy to use and GL core contexts so easy to set up with Qt, I immediately thought of using Qt as the my windowing toolkit. A few questions come to my mind when thinking about it.


    a) how much overhead does Qt produce when rendering ONLY the GL drawable in a window or fullscreen?
    b) how big is the penalty for rendering additional text?
    c) how big when combining the GL output (possibly with text) and regular Qt widgets?

    Since I'm interested in high performance in developing a very high performance library, QGLWidget's efficiency is very importend to me. What are the possible considerations to make when using it for my task. Should I consider NOT using Qt as the API of choice? Might SDL or something like it be a better alternative?

    Thanks everyone!


  • From my experience, the performance is quite good. I use QGLWidget to setup the context and that's about it. From then on, I write all of the other OpenGL code myself. That includes creating textures, rendering fonts and images. I havn't seen any slowdown when doing this. I've also been able to use the QGLWidget in an editor tool without any problems. In that case, I still do all the OpenGL rendering myself, but the widgets for the rest of the tool is rendered outside of the OpenGL context by Qt. I've not tried rendering Qt Widgets inside of the OpenGL widget.

Log in to reply