[PyKDE] Use of enum in a namespace with SIP

Claus, Richard claus at slac.stanford.edu
Tue May 3 22:34:59 BST 2005


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?

	Thanks,
		Ric




More information about the PyQt mailing list