[PyQt] problem with passing tuple with pyqt4 signal/slot mechanism
Phil Thompson
phil at riverbankcomputing.co.uk
Thu Apr 26 16:03:41 BST 2007
On Thursday 26 April 2007 3:35 pm, Andreas Pakulat wrote:
> On 26.04.07 19:39:30, Pradnyesh Sawant wrote:
> > Hello,
> > I have a pyqt4 code in which i'm trying the signal/slot mechanism. The
> > (stripped) code is as follows:
> >
> > class D(QtCore.QThread):
> > def __init__(self):
> > QtCore.QThread.__init__(self)
> > tpl = ("Primary", "priSec")
> > print "tpl:", tpl
> > self.emit(QtCore.SIGNAL("setLabel"), tpl)
> > QtCore.QObject.connect(d, QtCore.SIGNAL("setLabel"),
> > dialog.setLabel, QtCore.Qt.QueuedConnection)
> > sys.exit(dialog.exec_())
> >
> > Can anyone kindly tell me what's happening here?
>
> You have to say which arguments your signal transports, i.e. use
> SIGNAL("setLabel(PyObject*)") in both cases. Else your argument will
> just be dropped.
That's not necessary. Missing out the parenthesis has the same effect.
Phil
More information about the PyQt
mailing list