> Date: Thu, 9 Dec 2010 22:33:26 +0000 > From: [email protected] > To: [email protected] > CC: [email protected] > Subject: Re: [PyQt] Getting around Circualr references in SIP modules > > On Thu, 9 Dec 2010 14:17:31 -0800, Nate Reid <[email protected]> wrote: > > I am wrapping a set of components that are generally independent of each > > other, but not always. > > > > For example, I have > > /////// > > // foo module > > %Module foo > > %Import common.sip // Need to get a Blah > > %Include SomeClass.sip > > > > Blah* getTheBlah(); > > %MethodCode > > sipRes = ... > > %End > > > > /////// > > // SomeClass.sip > > class SomeClass > > { > > %TypeHeaderCode > > ... > > > > }; > > > > /////// > > // common.sip > > %Module common > > %Import foo // Need SomeClass > > class Blah{ > > ... > > SomeClass* getVal(); > > }; > > > > > > So, common and foo are different modules but they use classes from each > > other's modules. How do I get around this problem? Is there something > I > > can do with ConsolidatedModule, or what not to still et these modules be > > build and installed independently but get around this circular reference > / > > Import issue? > > They probably all need to be part of the same module, but you could try > playing with the /External/ class annotation. > > Phil However, namespaces seem to make things difficult: //////////////////////////// // SomeClass.sip namespace myns { class SomeClass { %TypeHeaderCode #include <path/to/myns/SomeClass.h> ... }; }; /////// // common.sip %Module common %Import foo // Need SomeClass namespace myns { class SomeClass /External/; }; class Blah{ ... myns::SomeClass* getVal(); }; I get a SIP error: sip: /path/to/common.sip:# External classes/structs can only be declared in the global scope So, when I change common.sip to: class myns::SomeClass /External/; I get: sip: /path/to/common.sip:# The struct/class has already been defined Still possible to use External? -Nate
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
