[PyQt] Simple connect does not work

Mads Ipsen mpi at comxnet.dk
Fri Apr 24 08:43:53 BST 2009


> On Friday 24 April 2009, Mads Ipsen wrote:
>
>> OK, I need to use a signature (see below). Sorry for bothering you!
>>
>> class SpinBox(QtGui.QSpinBox):
>>     def __init__(self, parent=None):
>>         QtGui.QSpinBox.__init__(self, parent)
>>
>>     @QtCore.pyqtSignature("int")
>>     def foo(self, i):
>>         print i
>
> Or perhaps:
>
> QtCore.QObject.connect(spin, QtCore.SIGNAL('valueChanged(int)'), spin.foo)
>
> --
> Jan Ekholm
> jan.ekholm at smultron.net
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

That's the way that I normally would approach it, sure. But I wanted to
know how the SIGNAL, SLOT approach works - and there a signature is
needed.

Best regards,

Mads


More information about the PyQt mailing list