*** GMX Spamverdacht *** [PyQt] problem with passing tuple with pyqt4 signal/slot mechanism

Andreas Pakulat apaku at gmx.de
Thu Apr 26 15:35:44 BST 2007


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.

Andreas

-- 
You plan things that you do not even attempt because of your extreme caution.


More information about the PyQt mailing list