[PyQt] noob woes (but still making progress)

Phil Thompson phil at riverbankcomputing.co.uk
Tue May 15 22:16:04 BST 2007


On Tuesday 15 May 2007 7:50 pm, Jason Hihn wrote:
> Ok, I have several questions.
>
>
>
> I probably have a sub-optimal set of headers. Is there a limitation of one
> class per header? How do we generate .sip files for .h that contain several
> classes? i.e.:
>
> aaa.h:
>
> class aaa{};
>
> class bbb{};
>
> aaa.sip
>
> class aaa:
>
> %TypeHeaderCode
>
> #include aaa.h
>
> %End
>
> class bbb:
>
> %TypeHeaderCode
>
> #include aaa.h //<- is this ok?
>
> %End

SIP doesn't place any restrictions on how many classes are defined in a .sip 
file. Normal practice is to have one .sip file for each .h file.

> Secondly, how do we generate a package say, File.pyd, that contains all the
> classes that class A relies on?
>
> aaa.h includes ccc.h, so class CCC needs to be wrapped, which includes
> ddd.h, which also needs to be wrapped. Which is ok, and I get aaa to be
> wrapped, but in the python interpreter it fails on import saying that ccc
> module is missing.

You run SIP on a .sip file. If your classes are split across multiple .sip 
files then make sure they are %Include'd by the .sip file you pass to SIP - 
see the docs.

Phil


More information about the PyQt mailing list