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

Marcus Lindblom macke at yar.nu
Tue Apr 7 09:39:31 CEST 2009


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



More information about the Cplusplus-sig mailing list