From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.

QOpenGLWidget force initialisation

  • Hi there,
    I am trying to setup 2 QOpenGLWidget as tabs in a QTabWidget.
    I need to perform initialisation in the GL widgets requiring the context at some point (shaders init).
    The problem is that the OpenGLWidget that is located in the visible tab is well initialised, but the other one not (certainly because it is not visible).
    What is the correct way to force the initialisation of this second GLWidget programmatically ?

  • You'll need to change the context to the second GL widgets before using it.
    As each time you render or do anything with OpenGL setup/parameters that you have the right context selected first for each widget.