[PyKDE] Binding special connect functions

Phil Thompson phil at riverbankcomputing.co.uk
Mon Oct 27 10:54:01 GMT 2003


On Monday 27 October 2003 9:07 am, Aurélien Gâteau wrote:
> Hi list!
>
> I'm trying to bind some special connect functions with SIP 3.7. The C++
> code looks like this:
> /--
> namespace DolSphinx {
> void connectVolumeChanged(QObject* object, const char* receiver);
> }
> --/
>
> Based on the QTimer sip code, I tried something like this:
> /---
> void connectVolumeChanged(SIP_RXOBJ_CON,SIP_SLOT_CON());
> ---/
>
> But it doesn't work: the C++ signal to which this function connects is :
> /---
> void volumeChanged(int)
> ---/
>
> The binding compiles correctly, I can connect a slot using
> "connectVolumeChanged" from my Python code, but whenever the
> "volumeChanged" signal is emitted, I get TypeError messages like this:
> /---
> TypeError: setValue() takes exactly 2 arguments (1 given)
> ---/
>
> It seems the emitted signal does not contain my "int" parameter.
>
> What's the way to bind this kind of code?

Put the parameter types in the SIP_SLOT_CON()...

void connectVolumeChanged(SIP_RXOBJ_CON,SIP_SLOT_CON(int));

See QMovie.connectResize() for an example.

Phil




More information about the PyQt mailing list