[C++-sig] pybindgen and PyQt

Hans Meine hans_meine at gmx.net
Fri Sep 19 20:20:48 CEST 2008


On Freitag 19 September 2008, Andreas Eriksson wrote:
> are you referring to the following from
> http://mail.python.org/pipermail/c++-sig/2005-November/009865.html?
> [...]
> > #include <sipvigraqtDeclvigraqt.h> // my SIP module was called vigraqt
> >
> > PyObject *getViewer()
> > {
> >     return sipMapCppToSelfSubClass(
> >         somehowGetViewer(), sipClass_QImageViewer);
> > }
> >
> > BOOST_PYTHON_MODULE_INIT(sipbridge)
> > {
> >     def("viewer", &getViewer);
> > }

Correct, that's how I did the to-python conversion.  Of course, the C++ object 
must not be destroyed before the python one, but I am not so sure about the 
lifecycle management in SIP and at least this is a working start.  Probably 
you cannot even do much better.

-- 
Ciao, /  /                                                    .o.
     /--/                                                     ..o
    /  / ANS                                                  ooo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080919/d3d0b51b/attachment.pgp>


More information about the Cplusplus-sig mailing list