During a paint event, How can I reuse previous paintings so that I can just paint on top of the previous result. Right now the whole rendering area needs repainting.
gonna try QPixmap.
Do I absolutely need to use update?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You want to cache the painting in a
QImageorQPixmap(probably aQPixmap). If you do this a lot, you might also want to look atQPixmapCache.Additionally, a lot of drawing can be calculated beforehand, then fairly quickly done using
QPainterPaths. I will often use them and recalculate when necessary, rather than caching the whole paint event in a pixmap.Edit:
I also ran into a brief mention of QPicture, which might also be something you want to look at: