Hi all,

I need to emit some signals from a class inheriting from QThread so I need to 
inherit from QObject too but PyQt has no support for multiple inheritance so 
I tried following code to fake it :

===============================
from qt import *

class MyQObject(QObject):
    def __init__(self):
        QObject.__init__(self)

class MyQThread(QThread):
    def __init__(self):
        QThread.__init__(self)

class Thread(MyQThread, MyQObject):
    def __init__(self):
        MyQThread.__init__(self)
        MyQObject.__init__(self)
        self.emit(PYSIGNAL('success()'), ('',))

def test():
    foo = Thread()

if __name__ == "__main__":
    test()
===============================

but it doesn't work as expected and gives attribute error on line 21 :  
self.emit(PYSIGNAL('success()'), ('',)) part. So its not really inheriting 
from QObject. I wonder if anyone knows if we can fake multiple inheritance 
like this or is it impossible ?

Regards,
ismail

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to