[review] [PyKDE] Does SIP support nested class definition

Jim Bublitz jbublitz at nwinternet.com
Tue Aug 2 05:02:38 BST 2005


On Monday 01 August 2005 17:25, John Drummond wrote:
> Hi, Im trying to wrap a C++ class that has another class nested within it.
>
> I looked at PyQt sip files to find an example and qdawg.sip shows a
> nested class, so I assume it should work.
>
> class Cmf : SMLEvent, SMLMessageReceiver
> {
> %TypeHeaderCode
> #include "cmf.h"
> %End
> public:
>     Cmf(Cmf* = 0, int=false);
>
>     class CommonStatus : SMLMessage
>     {
>     public:
>         CommonStatus(unsigned char= 0);
>         int IsMOBGuarding();
>     };
> };
>
> No sip errors but I get the following error in sipsmlCmfCommonStatus.cpp
> when compiling:
> error C2039: 'Cmf' : is not a member of 'CommonStatus
>
>         Cmf::CommonStatus *sipCpp;
>         if
> (sipParseArgs(&sipArgsParsed,sipArgs,"m",sipSelf,sipClass_Cmf_CommonStatus,
>&sipCpp)) {
>             int sipRes;
>
>             sipRes = sipCpp -> Cmf::CommonStatus::IsMOBGuarding();
>
>             return PyInt_FromLong((long)sipRes);
>         }
>
> If I manually edit sipsmlCmfCommonStatus.cpp and change
> sipRes = sipCpp -> Cmf::CommonStatus::IsMOBGuarding();
> to
> sipRes = sipCpp -> IsMOBGuarding();
> then it compiles.


Which compiler and OS are  you using?

The fully qualified method name (x::y->x::y::z()) is accepted by gcc/Linux - 
KURL::List in PyKDE has similar generated code and compiles correctly.

Jim




More information about the PyQt mailing list