[PyKDE] namespaces in sip

Patrick Stinson ajole-1 at gci.net
Thu Oct 16 07:53:01 BST 2003


a.h
----------------------------------
namespace PK
{
class A {};
}

b.h
------------------------------------
namespace PK
{
class B{};
}

pkmod.sip
-----------------------------------
%Module PK
%Include a.sip
%Include b.sip

a.sip
-------------------------------------
/* same as a.h */

b.sip
-------------------------------------
/* same as b.h */


I'm working on modifying my sip project to include a lot of classes all 
contained in the same C++ namespace. What is the correct way to organize the 
sip files? Do all classes in the namespace have to be declared within the 
namespace in the same sip file? 

Right now I have added the namespace decl and brackets in each class' sip 
file, all of which are included in the module file, just like in PyQt. When 
it's like this, I get a sip parse error on the line including the second file 
with a namespace decl. 


P.S. Phil: it is great getting responses from you. The pleasure of using sip 
is increased by the friendly and active nature of it's community and author! 
Cheers!




More information about the PyQt mailing list