[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Listview problem? (segfault)
From:       Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date:       2002-07-31 9:02:46
[Download RAW message or body]

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


_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic