I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class:
self.loginDialog = LoginDialog();
What @bialix suggested should have worked, but try an alternative way of connecting:
class Foo(QtCore.QObject):
mysignal = QtCore.pyqtSignal(str, name='mysignal')
def connect_to_signal(self):
# you can use this syntax instead of the 'old' one
self.mysignal.connect(self.myslot)
# but this will also work
self.connect(self, QtCore.SIGNAL('mysignal(QString)'), self.myslot)
self.mysignal.emit("hello")
def myslot(self, param):
print "received %s" % param
For a more detailed explanation of how signals/slots work in PyQt I'd suggest going through it's documentation, specifically this section.