[C++-sig] PyQt (SIP) and Boost.Python interop?

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Apr 9 01:32:07 CEST 2009


Since I didn't see any other responses, I'll offer what I know, even though it doesn't directly answer
your question.

A few years ago I experimented with SWIG - Boost.Python integration, where you can get easy access
from C++ to SWIG-wrapped objects, inside a function wrapped with Boost.Python. The code is here:

http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/boost_adaptbx/

Look for the files swig_arg.hpp, swig_args_ext.cpp, and search for "libswig" in the
SConscript.

I haven't tried this out for a long time.
Anyway, I hope it gives you a start.


Ralf



----- Original Message ----
From: Marcus Lindblom <macke at yar.nu>
To: cplusplus-sig at python.org
Sent: Tuesday, April 7, 2009 12:39:31 AM
Subject: [C++-sig] PyQt (SIP) and Boost.Python interop?

Hi,

We're in a spot where we're using third-party libraries that use different python wrappers. (Boost.Python, SIP currently, possibly SWIG later).

Our own C++-classes are wrapped with Boost.Python a.t.m, but some of them contain Qt-objects, so PyQT needs to be used for that. Python is dynamic, so this ought to be doable, if not easy. :)

Has anyone attempted to get this to work?
What is the best strategy?
Any pitfalls?
Any code? :)

I did manage to write a __getattr__ for my boost.python-wrapped qobject-inheriting classes that forwards to pyqt, but it won't work for dir() and I haven't managed to write __dir__ for my class as I need the self-object to be able to get the pyqt/sip wrapped instance.

All help greatly appreciated.

Cheers,
/Marcus

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig at python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig




More information about the Cplusplus-sig mailing list