In my application there's a mechanism which "snaps" certain instances of the openGL scene in a fbo (something like a snapshot but keeping also the depth information). Those snaps are used at certain moments where, instead of calling the actual draw in paintGL, those snapshots are used in order to avoid heavy drawing. This means that I don't want to just call:"update()" to schedule a paint event because this is what I want to avoid.

With old Qt (e.g. v4.8.x) I used to call blit of that fbo to default framebuffer (0) and then called a swapBuffers. With Qt v5.15.x (As far as I saw, there's nothing changed in v6.x) I cannot achieve this. These are the actual steps used:

1) Make current the QGLWidget (now I've changed this to QOpenGLWidget)
2) blit the fbo to default framebuffer
3) Begin a QPainter on default framebuffer in order to write some info (text)
4) Swap the buffers

At step (2) I've tried to copy to the "defaultFramebufferObject" of QOpenGLWidget as documentation states but nothing happens. I get an openGL error message about invalid fbo. By the way, I've printed the id of the defaultFramebufferObject and is 0 while during in paintGL (where snap occurs) it seems to be a different number, like 2 or 3.

I've also tried to bypass step (3) in order to avoid using QPainter.

Any ideas? Or maybe give me an idea with pseudocode how is it possible to draw something outside paintGL. Thanks