Hi,

I try to subclass the QObject class, but I encounter, IMHO, strange
problem - I can create only one instance of my QObject subclass. It
seems that it is not allowed to do anything in the QObject subclass
__init__() method until the QObject.__init__() is called.

I don't see any reason for this kind of limitation, from Python point of
view. Please correct me if I'm wrong.

I attached a simple Python script, which demonstrates the problem.

Best Regards,
Marcin
#!/usr/bin/env python

from PySide import QtCore

class MyBaseObject(QtCore.QObject):
    mySignal = QtCore.Signal()

    def __init__(self):
        QtCore.QObject.__init__(self)
        self.mySignal.connect(self.mySlot)

    @QtCore.Slot()
    def mySlot(self):
        pass

class MyObject(MyBaseObject):
    def __init__(self):
        self.a = 'a'
        MyBaseObject.__init__(self)

obj1 = MyObject()
obj2 = MyObject()
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to