Re: [C++-sig] porting Qt 3.3.x to python
Thanks. PyQt package is built with SIP. I tried to use PyQt objects from a code wrapped with boost/python but, at least in my naïve example, same object (name) in boost and in PyQt have different 'signature'. Is there a way to bridge between the 2 python wrappers? Can I tell boost to use qt objects from PyQt instead of generating it's own version of them? -----Original Message----- From: c++-sig-bounces@python.org [mailto:c++-sig-bounces@python.org] On Behalf Of Fran?ois Duranleau Sent: Monday, November 21, 2005 7:05 PM To: Development of Python/C++ integration Subject: Re: [C++-sig] porting Qt 3.3.x to python On Sat, 19 Nov 2005, Seker, Noam wrote:
Hi, Is there an available boost/python package for Qt 3.3.x? thanks
Here you go: http://www.riverbankcomputing.co.uk/pyqt/ -- François Duranleau LIGUM, Université de Montréal "[...] consider McDonalds -- it is fast, cheap, and used by millions. However, it also contributes to obesity, heart disease, and (arguably) deforestation." - Prof. Gene Spafford, in email about Windows supplanting other operating systems in Universities
--- "Seker, Noam" <noam.seker@intel.com> wrote:
Thanks. PyQt package is built with SIP. I tried to use PyQt objects from a code wrapped with boost/python but, at least in my naïve example, same object (name) in boost and in PyQt have different 'signature'. Is there a way to bridge between the 2 python wrappers?
I am not aware of interfaces between SIP-generated wrappers and Boost.Python.
Can I tell boost to use qt objects from PyQt instead of generating it's own version of them?
That's probably something you'd have to figure out yourself. A few months ago someone asked a similar question regarding SWIG. It was surprisingly easy to support passing SWIG-wrapped objects to Boost.Python wrapped functions: http://cvs.sourceforge.net/viewcvs.py/cctbx/boost_adaptbx/swig_arg.hpp?view=... http://cvs.sourceforge.net/viewcvs.py/cctbx/boost_adaptbx/swig_args_ext.cpp?... If you are lucky, maybe something similar works for SIP. You'd have to find out how the SIP wrapping mechanism works. HTH, Ralf __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
On Tuesday 22 November 2005 18:03, Ralf W. Grosse-Kunstleve wrote:
Can I tell boost to use qt objects from PyQt instead of generating it's own version of them?
That's probably something you'd have to figure out yourself. A few months ago someone asked a similar question regarding SWIG. It was surprisingly easy to support passing SWIG-wrapped objects to Boost.Python wrapped functions:
http://cvs.sourceforge.net/viewcvs.py/cctbx/boost_adaptbx/swig_arg.hpp?view =markup
http://cvs.sourceforge.net/viewcvs.py/cctbx/boost_adaptbx/swig_args_ext.cpp ?view=markup
If you are lucky, maybe something similar works for SIP. You'd have to find out how the SIP wrapping mechanism works.
Yes, it is possible; for example I did it with code fragments like these (this is also a hint for Jan Langer how such a thing could look like): #include <sipvigraqtDeclvigraqt.h> // my SIP module was called vigraqt PyObject *getViewer() { return sipMapCppToSelfSubClass( somehowGetViewer(), sipClass_QImageViewer); } BOOST_PYTHON_MODULE_INIT(sipbridge) { def("viewer", &getViewer); } -- Ciao, / / /--/ / / ANS
participants (3)
-
Hans Meine -
Ralf W. Grosse-Kunstleve -
Seker, Noam