[PyKDE] Re: sip SIGNAL/proxy problem

Phil Thompson phil at riverbankcomputing.co.uk
Wed Dec 24 21:07:01 GMT 2003


On Sunday 21 December 2003 9:26 pm, Jim Bublitz wrote:
> There appears to be a sip problem as described in the following
> PyKDE list thread:
>
>     [PyKDE] un-connectable signals (probably sip bug)
>
> Basically the situation is this (WId is just an example of the
> general problem):
>
> WId is defined in qwindowdefs_x11.sip as:
>
>     typedef unsigned long WId;
>
> In kdecore/KWinModule, the *signal*:
>
>     void windowAdded (WId);
>
> is defined.
>
> kdecore proxies unsigned long, so the following should work :
>
>     wm = KWinModule ()
>     wm.connect (wm, SIGNAL ("windowAdded (unsigned long)"),
>         someSlot)

Just to confirm that the problem is that SIP uses the real types in signals 
whereas MOC uses the supplied types without worrying about what the real type 
is. For example...

typedef unsigned long WId

signals:
	void sig(WId);
	void sig(unsigned long);

SIP will complain because the signatures are the same. MOC won't - but the C++ 
compiler will.

I can change SIP, but it generates a QObject based proxy class that contains a 
handler for each unique signal defined in the module. Therefore, if the above 
example signatures were in different classes then the changed behaviour would 
mean that the proxy wouldn't compile.

Are there any examples like this in any PyKDE module?

If not then I can just change the behaviour to be MOC-like.

If so then I need to do something more complicated.

Phil




More information about the PyQt mailing list