From pykde Sun Aug 20 15:05:55 2006 From: David Boddie Date: Sun, 20 Aug 2006 15:05:55 +0000 To: pykde Subject: Re: [PyKDE] Wrapping a custom Model into Python Message-Id: <200608201705.55953.david () boddie ! org ! uk> X-MARC-Message: https://marc.info/?l=pykde&m=115608655007306 On Wed Aug 16 21:33:34 MEST 2006, Andreas Pakulat wrote: > On 16.08.06 15:14:18, Tobias Rundström wrote: > > What is the best practice of wrapping a custom QAbstractItemModel into > > PyQt? I developed a ItemModel that I want to use in a C++ program as > > well as in my Python program, the best way seems to be to write it in > > C++ and then wrap it into PyQt, this allows sharing the model code. What > > is the best way of doing this? > > I think you're looking for sip and it's documentation. That's what is > used to build PyQt and thus it shouldn't be too hard to use for a code > model. I'm not sure but you might need to put the model into a shared > library. Depending on the way it's going to be used, it could either be create as a separate shared library, or just compiled in with the Python-specific code for the shared library module. Using SIP is the subject of an appendix in "GUI Programming with Python": http://www.commandprompt.com/community/pyqt/a8834 The SIP Reference Guide is available on the Riverbank Web site: http://www.riverbankcomputing.com/Docs/sip4/sipref.html David _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde