Hi,
I'm trying to use QPainter inside a QGLWidget to draw images and rectangles, circles, ... using OpenGL backend.
First I display an image using a QPainter and painting a QPixmap.
Then I paint a rectangle using a QPainter and painting it.
The problem is that the second painting clears the image(normal behaviour as I can read).
I can't store the image to repaint it adding the other elements so I want to keep the already painted elements to not be cleared.
Is there anyway to paint above what is already painted?
From Qt doc, it says that QPainter can only be used inside the paintEvent when the PaintDevice is a Widget(this is the case), but I'm using it outside the paintEvent without problem.
Thanks,
Bookmarks