[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Wrapping a custom Model into Python
From:       David Boddie <david () boddie ! org ! uk>
Date:       2006-08-20 15:05:55
Message-ID: 200608201705.55953.david () boddie ! org ! uk
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic