[PyKDE] Use of postEvent

greg Landrum greglandrum at mindspring.com
Thu Mar 21 01:18:52 GMT 2002


(apologies if this arrives a second time... I used the wrong return address 
on the last one so it got held up by mailman)


[System details: RH linux 7.1 kernel 2.4.2-2smp, Python 2.1.1, Qt 3.0.2, 
PyQT/Sip-3.1rc2]

I just started using PyQt recently (I'm kind of a refugee from wxPython) 
and I'm really impressed.  Qt itself is pretty nice and PyQt really adds to 
it.  Thanks for the hard work.

On to my question/problem.

I'd like to add some RPC control to my application.  So I've got a PyQt 
application running in one thread and an xmlrpc server running in 
another.  Whenever the xmlrpc server gets a call, it constructs a special 
event and fires that into the event queue for the main app using 
postEvent.   I've built a similar system for wxPython to do this, so the 
xmlrpc/multithreading/event queue bits were pretty straightforward to get 
working.  (Well, kind of, getting PyQt compiled with thread support fully 
enabled wasn't totally straightforward, more on this below).  Things now 
more or less work, but there's a snag: my event doesn't get processed by 
the application until I do something like move the mouse from one window to 
another or change focus or something like that.  Needless to say, this 
makes the RPC server somewhat less useful.  :-S

Any clues as to why this might be the case?

An aside about building PyQt with thread support:
I have a qt build with multi-threading enabled, but I had to screw around a 
bit with the PyQt and sip configure scripts to get them to enable thread 
support.  I know very little about configure, but it looks like the tests 
at around line  9440 in the sip configure script should have the "Regular 
Qt" case *after* the multithreaded and embedded cases.  Similarly, at line 
8899 in the configure script for PyQt, I had to move the 'qt' option to 
after 'qt-mt' and 'qte'. 





More information about the PyQt mailing list