I've Pie Shaped widgets that needs extensive paintings. So I want to cache the QPainter Once it have been painted in paintEvent. and reuse it latter. Is there any direct or hacky way of doing this ?
Asked
Active
Viewed 919 times
1 Answers
4
Use a QPixmap as a cache, QPainter can use it to paint onto directly as well.

cmannett85
- 21,725
- 8
- 76
- 119
-
So I need to set the size of the QPixmap same as the size of Widget ? – Neel Basu Sep 12 '11 at 16:37
-
Yes. QPixmap is QPaintDevice derived, so think of it as a canvas. – cmannett85 Sep 12 '11 at 18:37