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();
As noted by gruszczy you have to use the same QtCore.SIGNAL('xxx') to connect signal and to emit it. Also I think you should use Qt types in the arguments list of signal function. E.g.:
QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("aa(QString&)"), self.login)
And then emit with:
self.emit(QtCore.SIGNAL("aa(QString&)"), "jacek")
Sometimes it makes sense to define signal only once as global variable and use it elsewhere:
MYSIGNAL = QtCore.SIGNAL("aa(QString&)")
...
QtCore.QObject.connect(self.loginDialog, MYSIGNAL, self.login)
...
self.emit(MYSIGNAL, "jacek")