I was wondering what the most efficient way to paint a mostly-static QWidget
with several overplayed, semi-transparent gradients would be. I'm considering two options:
- Just place all the painting code in the
paintEvent
function like usual. - Paint everything to a
QPixmap
when resized, and only paint theQPixmap
itself in thepaintEvent
.
I'm imagining the difference in performance between the two would rely heavily on how complicated the drawing code is, but is there a way to test this more quantitatively? Also, does anybody have any advice about which method should be used? (for all I know, the Qt painter does the pixmap caching behind the scenes)