[PyKDE] Listview problem? (segfault)

Phil Thompson phil at river-bank.demon.co.uk
Wed Jul 31 11:03:00 BST 2002


Paul Felix wrote:

 > Hi Bart,
 >
 > You might be able to avoid the problem by locking and unlocking the 
Qt library
 > mutex when creating each listview item:
 >
 >   qApp.lock()
 >   QListViewItem(self.win.ListView1, "bleh")
 >   qApp.unlock()
 >
 > This seems to work for me using PyQt 3.3.2 and Qt 3.0.5.

Yes, I think this is the correct fix.

 > Phil, you advise calling the PyQt API from one thread only.  Do you 
see any
 > inherent problem in calling the PyQt API from a second thread if the 
Qt library
 > mutex is properly locked/unlocked when doing so?


I advise calling the PyQt API from one thread only *if* you are using
the Python thread module.

If you are using the Qt thread classes then you can call the PyQt API
from any thread so long as you handle the Qt global lock properly -
exactly as you suggest.

Phil





More information about the PyQt mailing list