Important: Please read the Qt Code of Conduct -

Provide QObject slots and signals features to another class?

  • Dear community,

    I am currently expanding a class to change it's connections to use QNetwork.
    So my code starts like this:

    @import PySide
    import anotherLib

    class myClass(anotherLib.originalClass):
    finished = QtCore.Signal(str)
    error = QtCore.Signal(str)
    def init(self,username,password):
    super(myClass,self).init(username, password)
    self.nam = QtNetwork.QNetworkAccessManager()
    def aMethod(self):

    I got an error: AttributeError: 'PySide.QtCore.Signal' object has no attribute 'emit'
    My signal is defined OUTSIDE of init so I don't understand why I have that error?

    Do I have to add anything else to obtain the Slots/Signal benefits?

  • Woops, I found the reason by myself...

    @class myClass(anotherLib.originalClass, QtCore.QObject):
    def init(self,username,password):

    Adding the QObject parent class and calling it during the init

Log in to reply