[PyKDE] un-connectable signals (probably sip bug)

Jim Bublitz jbublitz at nwinternet.com
Fri Dec 19 19:47:00 GMT 2003


On Thursday December 18 2003 10:44, Stefan Bund wrote:
> Hallo everybody,
>
> I have come across the following Problem: I cannot connect
> python methods to several KDE signals:
>
>   KWinModule::windowAdded(WId) is one,
>   KIO::Job::processedSize(KIO::Job*,KIO::filesize_t) is
> another.
>
> The problem seems to be with signal signatures containing some
> problematic types (maybe all typedefs for primitive types?). I
> have tried to understand the Problem reading the sip-generated
> C++-code (in kdecorecmodule.cpp) and the sip sourcecode. For
> some reason or other, the proxySlot declarations for some
> singal signatures are missing (for example, in
> kdecorecmodule.cpp, the are *no* proxySlot definitions for
> *any* signal signatures containing the WId typedef).

But there are for "unsigned long" and "ulonglong".

> I am using python2.2 and sip, pyqt and pykde 3.8. There does
> not seem to be a version of pyqt/pykde compatible with sip 3.9
> yet.

Correct

> Is there any workaround? Is this bug known? Is it corrected in
> sip 3.9? Is it somehow possible to use sip 3.9 with pyqt/pykde
> 3.8? Any other sollution/bugfix?

I've never checked these out, but I suspect the problem is with 
the typedef'd types. WId is typedef'd from unsigned long, and 
filesize_t from unsigned long long, which is further complicated 
by being a mapped type of ulonglong in PyKDE.

I'm not sure exactly what will work, but the WId signals should 
work if you specify either "unsigned long", "long", or "ulong"   
in place of WId (I'd try them in that order). For filesize_t, 
I'd try "ulonglong", "KIO::ulonglong", or "unsigned long long". 
I don't think the last will work at all, because I don't believe 
sip has long long as a basic type (which is why PyKDE uses the 
invented "longlong" and "ulonglong" to begin with).

Please let me know if any of that works out, and I'll update the 
docs.

Phil: Is there a way to get the proxy code to pick up, for 
example, WId if:

    typedef unsigned long WId;

Right now I have these in the body of the sip files - should they 
be in the %HeaderCode blocks instead, or will it be necessary to 
always use the base type instead of the defined type?

Jim




More information about the PyQt mailing list