Re: [C++-sig] sending a c++ class to a python function

2011-09-01 Thread Josh Stratton
That worked. Thanks. I had trouble getting it to work as a template, so I just removed that portion. //template inline Scene* get_pointer(QSharedPointer const &p) { return p.data(); // or whatever } On Tue, Aug 30, 2011 at 10:57 AM, Jim Bosch wrote: > On 08/30/2011 07:45 AM, Josh Stratton

Re: [C++-sig] sending a c++ class to a python function

2011-08-30 Thread Jim Bosch
On 08/30/2011 07:45 AM, Josh Stratton wrote: Oh, okay. So I can create a module... #include "scene.h" BOOST_PYTHON_MODULE(scene) { class_("Scene"); } and then import it (even though) in my python I normally don't import things I'm not creating. I'm assuming this is a boost-python thing t

Re: [C++-sig] sending a c++ class to a python function

2011-08-30 Thread Josh Stratton
Oh, okay. So I can create a module... #include "scene.h" BOOST_PYTHON_MODULE(scene) { class_("Scene"); } and then import it (even though) in my python I normally don't import things I'm not creating. I'm assuming this is a boost-python thing to get the class into scope, which gets rid of th

Re: [C++-sig] sending a c++ class to a python function

2011-08-29 Thread Jim Bosch
Normally a to-python converter is needed when you have a function that returns a C++ object, and you want to wrap that function so the returned thing can be used in Python. I don't see any functions that return a Scene object. They will also enable expressions of the form "object(scene)", but

[C++-sig] sending a c++ class to a python function

2011-08-28 Thread Josh Stratton
I'm getting an error when I try to pass down my object that results in a seg fault. I've registered my class I'm sending down, but when I actually send it, my program exits at this line in the library right after I call the importFile() function... return call(get_managed_object(self, tag