[PyKDE] Re: Use of enum in a namespace with SIP

Phil Thompson phil at riverbankcomputing.co.uk
Wed May 4 19:43:51 BST 2005


On Tuesday 03 May 2005 10:34 pm, Claus, Richard wrote:
> Hello,
>
>   The following sip code does not produce compilable code with sip 4.2
> (4.2rc2-289, Windows XP SP2).
>
> %Module MyTest
>
> namespace MyNamespace {
>
> enum MyEnum {a, b, c, d};
>
> };
>
> The generated sipMyTestMyNamespace.cpp code contains references to
> MyNamespace::a, etc., where the namespace MyNamespace is undefined.  I
> can't seem to figure out how to get a "#include" directive to appear in the
> generated code that would define the namespace.
>
> Secondly, I can't seem to provide a reference to the enum's members as
> defined in some C++ code.  Any %<xxx>Code directive produces a "syntax
> error" message.
>
> Can anyone shed some light on this, or am I obliged to move the enum into a
> class definition?

It's on the TODO list - I'll look at doing it sooner rather than later.

Phil




More information about the PyQt mailing list