[PyQt] Beginners - signal - slots - question

Henrik Pauli henrik.pauli at gmail.com
Sat Dec 22 17:07:07 GMT 2007


On Saturday 22 December 2007, Phil Thompson wrote:
> On Saturday 22 December 2007, Henrik Pauli wrote:
> > 
> [...]
> > QtCore.QObject.connect(self.lineEdit,QtCore.SIGNAL("returnPressed()"),
> >                           self.blabla)
> > QtCore.QObject.connect(self, QtCore.PYSIGNAL("blabla2"),
> >                           self.lb_ergebnis,
> > QtCore.SLOT("setText(QString)")) ## no () after a pysignal's name
> >
> > def blabla(self):
> > 	#some code
> > 	self.emit( PYSIGNAL("blabla2"), (myString,) )
> > ## N.B. the comma after the argument, that’s so it's a tuple.
>
> Note that this is PyQt3. In PyQt4 it is...
>
>     self.emit(QtCore.SIGNAL("blabla2"), myString)
>

Ah yes, that’s what I get for cheating from the KDE3/Qt3 part of my software, 
hehehe!  Thanks for the quick correction!



More information about the PyQt mailing list