[PyKDE] Does SIP support nested class definition

John Drummond john.drummond at homecall.co.uk
Tue Aug 2 01:25:07 BST 2005


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.

Thanks in advance.

-- 
John Drummond
Home email: mailto:john.drummond at homecall.co.uk




More information about the PyQt mailing list