Qt5: Drawing some graphics on top of QOpenGLWidget

165 Views Asked by At

I'm building an app which uses Qt5 that aims to display a video from a digital camera (using Gstramer pipeline). Then with the help of QPainter I'm drawing some graphics on top of it (some text shapes, and icons).

The thing is that the video refresh rate is ~30 FPS, and I only need to update the graphics in ~10 FPS or so. Currently I redraw the graphics overlay for every video frame which is very wasteful in terms of CPU.

Is there a better approach in which I can re-use the overlay from the previous frame, and only update the background (the frame from the camera)?

One idea that I had was to paint the overlay into a QImage, and then just paint the image onto the QOpenGLWidget, but it just feels wrong.

Thank you...

0

There are 0 best solutions below