python - PyQt4 signals and slots -


i writing first python app pyqt4. have mainwindow , dialog class, part of mainwindow class:

self.logindialog = logindialog(); 

i use slots , signals. here's connection made in mainwindow:

qtcore.qobject.connect(self.logindialog, qtcore.signal("aa(str)"), self.login) 

and try emit signal inside dialog class (i'm sure emitted):

self.emit(qtcore.signal("aa"), "jacek") 

unfortunately, slot not invoked. tried no arguments well, different styles of emitting signal. no errors, no warnings in code. might problem?

you don't use same signal, when emitting , connecting.

qtcore.signal("aa(str)") not same qtcore.signal("aa"). signals must have same signature. way, if defining own signals, don't define parametres. write signal('aa'), because defining parametres thing c++ , python version of qt doesn't need this.

so should this:

qtcore.qobject.connect(self.logindialog, qtcore.signal("aa"), self.login) 

and if pass parametres in emit, login method must accept parametres. check, if helps :-)


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -