Skip to content Skip to sidebar Skip to footer

Connecting Pyqt4 Signals In A Pyqt4 Qobject Class

I've got two classes; one for my window and one for my controlling object class window(baseClass, testForm): scanStarted = QtCore.pyqtSignal(str) def __init__(self,parent=N

Solution 1:

You forgot to initialize the QObject:

class vis(QtCore.QObject):
    def __init__(self, parent=None):
        super(vis, self).__init__(parent) # you are missing this line
                                          # also the `parent` arg
        self._oreList = []

        self._w = window.window()
        self._w.scanStarted.connect(self._scanOre)

    def _scanOre(self, rawText):
        print "main ->", rawText

Post a Comment for "Connecting Pyqt4 Signals In A Pyqt4 Qobject Class"