[PyKDE] PyQt Qthreads
Carles Pina i Estany
carles at pina.cat
Tue Oct 31 20:12:05 GMT 2006
On Oct/31/2006, Gregor Kling wrote:
> > 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 ?
some days ago I was porting a Python-Qt3 application to Python-Qt4, and
I used QCustomEvent.
I copy-paste some part of code:
In main thread (to receive the events):
#TODO: save in a variable the message number and compare event.type with this variable!
if (event.type() == QtCore.QEvent.Type(QtCore.QEvent.User+0)):
QtGui.QMessageBox.warning(self,"Error reading/writing files. Check permission of destination directory")
if (event.type() == QtCore.QEvent.Type(QtCore.QEvent.User+1)):
if (event.type() == QtCore.QEvent.Type(QtCore.QEvent.User+2)):
bla bla bla...
I _think_ that works fine, I have not tested a lot. I saw some rare error
in one execution, not 100% sure if it was because this piece of code
(I don't think so)
Hope that will help...
Carles Pina i Estany GPG id: 0x8CBDAE64
http://pinux.info Manresa - Barcelona
More information about the PyQt