[PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

Simon Edwards simon at simonzone.com
Sun Apr 19 09:25:11 BST 2009


Hello Phil,

I'm working on getting PyKDE4 trunk working on SIP 4.8 and PyQt 4.5 and 
hit what looks like a fairly straight forward regression bug.

The compile error is:

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip: 
In function ‘int convertTo_KSharedPtr_0200DNSSD_RemoteService(PyObject*, 
void**, int*, PyObject*)’:
/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247: 
error: ‘sipForceConvertTo_DNSSD’ was not declared in this scope 

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247: 
error: expected ‘,’ or ‘;’ before ‘::’ token 


The offending C++ code is:

     DNSSD::RemoteService *cpp = (DNSSD::RemoteService 
*)sipForceConvertTo_DNSSD::RemoteService (sipPy, &iserr);

which was expanded from the mapped type:

-----------------------------------------------
template <TYPE>
%MappedType KSharedPtr<TYPE>
{
// ... etc etc ...

%ConvertToTypeCode
     // Convert a Python instance to a Ptr on the heap.

     if (sipIsErr == NULL)
         return PyInstance_Check(sipPy);

     int iserr = 0;
     TYPE *cpp = (TYPE *)sipForceConvertTo_TYPE (sipPy, &iserr);
// ... etc etc ...
-----------------------------------------------

elsewhere in the sip files I've got this which sets it all in motion:

     typedef KSharedPtr<DNSSD::RemoteService> Ptr;

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
simon at simonzone.com       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."


More information about the PyQt mailing list