[PyKDE] PyQt Qthreads

Gregor Kling gregor.kling at dvz.fh-giessen.de
Tue Oct 31 19:54:12 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 Thnx Krzysztof,
> As far as I understand your code, in GUI you are running in loop,
> processing incoming pieces of data. This will not work, GUI updating is
> event-driven, so you should process one piece of data at the time and
> return control to GUI event processing loop to update GUI.
> In my apps I solve this problem by sending data to widgets in
> QCustomEvent. Something like that (note that this is for Qt3, not Qt4, I
> don't know if it has been changed):
In this case, regrettably i'm using Qt4, and there are no longer these
event-classes, i for one doesn't see them.
I found some examples, but they all use the customevent stuff.
So I have to dig deeper in the qt4-bibs.
So you have not another hint because of that you does not use
the qt4 port ?


> BTW. In your code you have race condition - if background thread does
> not send data fast enough, you would stop processing prematurely. You
> should use some other way of detecting if this is end of results, for
> example a flag saying that all results were sent.

Oh yes, in this case I know that. I'll try several general possibilties
to get the overall
understanding.
So back to to the drawing table...

cheers.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFR6nkJFHWQ694uCYRAqvvAJ9TUE6eUru36B3v0MTxEN3Dik4bsQCdH0aN
NNV/MFhw0fLYaDsYTHVMu1A=
=oZwk
-----END PGP SIGNATURE-----




More information about the PyQt mailing list