[PyKDE] Invalidation of windows

Jeremy Sanders jeremy at jeremysanders.net
Sun Mar 20 21:37:44 GMT 2005


I keep hitting a strange problem with Qt. I don't think the problem's in 
my code! Any idea how I can avoid this?

I have a document class which has a "dirty" flag. My output window (a 
QScrollView), checks the flag at intervals (using a QTimer). If the flag 
is set self.UpdateContents() is called.

In drawContents(), it checks the flag. If it is set it puts the output 
into a buffer pixmap, and uses painter.drawPixmap to put that to the 
QScrollView (over the entire thing if the dirty flag is set). The dirty 
flag is then reset.

I'm having problems where only part of the output window is getting 
overwritten using this procedure. It looks like Qt is doing some sort of 
clipping in drawContents(). This happens particularly with a popup menu 
which changes the program's output. When the popup closes, only the window 
beneath the popup is repainted. I can get round it much of the time by 
putting a app.eventLoop().processEvents(allevents, 100000) after the popup 
exec_loop().

Has anyone hit this problem before? Am I doing something stupid??

Now I need to work out how to get the random maybeTip tooltip exceptions I 
get occassionally...

Thanks

Jeremy


-- 
Jeremy Sanders <jeremy at jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053




More information about the PyQt mailing list