[PyQt] Sip: How to properly include from other files?

Jason Hihn jason at eyemaginations.com
Thu May 17 16:59:16 BST 2007


Hi all, I seems to have been a crazy week. Anyway, the sample seems to be
coming from the last read %Module definition. The docs were not clear that
there should only be one of these per entire module, and not one per file. 

Anyway, it compiles and links. I'd like to thank all of you for your help
this far.

My next question is how I can get my class to be loaded by QFormBuilder when
it loads a UI file at runtime? In my ui file it has a widget which was
promoted in QDesigner to my AAA class. So I want it to create an AAA widget
when it comes across one. I don't want to use uic. 

Basically, I do the following:
builder=QFormBuilder()
f=QFile(uifile)
f.open(QFile.ReadOnly)
widget=builder.load(f, parent)

Then I use widget.findChild() to pick up the controls at runtime and hold a
reference to them for connections, etc. 

In the builder.load() call is where I need it to be able to create my
widget. I don't know where to begin. It seem QFormBuilder has a modifiable
plug-in path (addPluginPath()) but I am unclear as to how Python/PyQt will
interfere with it, and what mechanisms are there to deal with it.

Thanks.

-----Original Message-----
From: pyqt-bounces at riverbankcomputing.com
[mailto:pyqt-bounces at riverbankcomputing.com] On Behalf Of Jason Hihn
Sent: Thursday, May 17, 2007 11:19 AM
To: 'Phil Thompson'; pyqt at riverbankcomputing.com
Subject: RE: [PyQt] Sip: How to properly include from other files?

Phenominal. I think I got it to almost work...

Now the issue seems to be that it insists on calling the module 'sample'

link /NOLOGO /DLL /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /OUT:sample.pyd
@C:\DOCUME~1\jason\LOCALS~1\Temp\nm48B5.tmp
   Creating library sample.lib and object sample.exp mt -nologo -manifest
sample.pyd.manifest -outputresource:sample.pyd;2

Where can I change this to be what it actually is?

-----Original Message-----
From: Phil Thompson [mailto:phil at riverbankcomputing.co.uk] 
Sent: Thursday, May 17, 2007 10:41 AM
To: pyqt at riverbankcomputing.com; jason at eyemaginations.com
Subject: Re: [PyQt] Sip: How to properly include from other files?

On Thursday 17 May 2007 3:15 pm, Jason Hihn wrote:
> I have a class I am trying to wrap, aaa, it is derived from bbb. Bbb has
> its own .h and .sip files. How do I properly get bbb into aaa's sip file
so
> that it is defined? I tried a %include, but then it errors on line 1 of
> bbb.h, because it is #ifndef .

In aaa.sip have...

%Include bbb.sip

However the normal convention is to have a mod.sip file which %Includes each

of the class .sip files. Then run sip over the mod.sip file.

Phil

_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list