[PyKDE] TypeError on emit()

Phil Thompson phil at riverbankcomputing.co.uk
Tue Feb 7 10:02:32 GMT 2006


On Tuesday 07 February 2006 7:39 am, Patrick Stinson wrote:
> I'm trying to emit a custom python signal. in PyQt3, you just did
> self.emit(PYSIGNAL('moved'),
> (delta,)). Appearantly you have to specifiy an argument list with the new
> custom signals, and use SIGNAL(), so I did:
>
> <type 'int'>
> Traceback (most recent call last):
>   File "/home/patrick/repos/pk/widgets/pixmapwidgets.py", line 379, in
> mouseMoveEvent
>     self.emit(SIGNAL('moved(int)'), [delta])
> TypeError: Argument 0 of signal QAbstractSlider.moved(int) has an invalid
> type
>
> I'm printing to the type of "delta" before the traceback to prove that it
> is an int. What's wrong with this picture?

"Argument list" in the normal programming sense - not as in a Python list of 
arguments. Remove the [].

Phil




More information about the PyQt mailing list