[PyKDE] Re: Singleshot problems in QThreads on Windows.
David Boddie
david at boddie.org.uk
Mon Aug 23 13:20:23 BST 2004
On Mon, 23 Aug 2004 10:44:30, Truls A. Tangstad wrote:
>On Sun, Aug 22, 2004 at 04:34:09PM +0200, David Boddie wrote:
>> My current solution is to post events from the non-GUI QThread, but not
>> include any data with them. The data is stored separately in a Python
>> object. I think that the interpreter can access the attributes of
>> pure-Python objects from any thread, and this appears to work well, but
>> you may be experiencing issues that prevent you from using this approach.
>
>What kind of events are you posting?
I'm posting custom events from a non-GUI QThread like this:
event = QCustomEvent(99999)
self.postEvent(self.receiver, event)
These are handled in the customEvent method of a class in the main/GUI
thread.
>> The code for qpython-0.55 should get uploaded today. It's not very pretty,
>> but I hope that you get something worthwhile out of it!
>
>I could not find any link or reference to it on the PyQt Wiki though.
Sorry about that. I couldn't actually upload the package to my hosting
provider. I've now added a link on the Wiki:
http://www.diotavelli.net/PyQtWiki/DevelopmentWithPyQt
>Thanks! Our current poll based implementation is working, but we'd
>really like to go back to using postEvent with data if we can get that
>working.
Maybe the trick is to ensure that the data is accessible, or at least
copied properly. I keep hoping that a higher authority will intervene and
give the definitive answer to your problem, but maybe we'll have to work it
out for ourselves.
David
___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com
More information about the PyQt
mailing list