Threaded QOpenGLWidget direct rendering

  • I'm in the process of upgrading from Qt 4.8 to Qt 5.9. What I want to do is do all of my opengl rendering in a separate thread like I could in Qt 4.8 with QGLWidget. I used to be able to call QGLWidget::makeCurrent in a separate thread and have it render straight to the screen. Is there a way to do that in Qt 5 without having to move the QOpenGLContext from the main thread to the worker thread like in the Threaded QOpenGLWidget example.

    My reason for this is there are a few functions in the GUI thread that can lock the GUI thread for a couple of seconds so that my opengl rendering doesn't run. I want my opengl thread to render to the screen no matter if the GUI thread is locked. I know the first thought is to move those GUI functions into a worker thread, but is there any way to do this so that rendering directly like it did in Qt 4?

Log in to reply