[Qt-interest] Why destroy QPainter after drawing?
Jason H
scorp1us at yahoo.com
Wed Jun 30 19:26:58 CEST 2010
I don't know for sure, but I would expect that each top level paint() gets a painter, which is passed to children and modified as needed by the kids.
i.e. a child could instill alpha(0.5) and that should be propagated to that kid's kids. If you hold onto a painter, the parent's painter could change (if the user changes display bit depth, for example) and your old painter would paint garbage, leading potentially to application crashes.
----- Original Message ----
From: Rohan Prabhu <rohan at rohanprabhu.com>
To: qt-interest <qt-interest at trolltech.com>
Sent: Wed, June 30, 2010 12:37:21 PM
Subject: [Qt-interest] Why destroy QPainter after drawing?
In the documentation for QPainter, it says that "Remember to destroy
the QPainter object after drawing", but doesn't provide a rationale as
to why. Why does it say so? Why is destroying QPainter necessary after
painting?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list