[Qt-interest] Problem with QPainter in paintEvent

Ender EREL erelender at yahoo.com
Wed Jul 29 08:27:06 CEST 2009


Are you deleting the painter you have created? If in every event you 
create a qpainter, you call begin but when you are finished, you do not 
delete the painter, therefore for the rest of the execution the painter 
lives.

You may want to try it like this:
void _qt_qwidget_QWidget__OnPaintEvent(maxHandle,event)
{
	QPainter painter(this); //calls begin automatically;
	// your painting tasks
}
This way when the end of the function scope is reached, painter gets 
destroyed.

-- 
Ender EREL



More information about the Qt-interest-old mailing list