[PyQt] passing a list by reference to C++ and back....
blaine.bell at schrodinger.com
Sun Jun 6 13:41:14 BST 2010
Phil Thompson wrote:
> On Fri, 04 Jun 2010 08:01:42 -0400, Blaine Bell
> <blaine.bell at schrodinger.com> wrote:
>> I have a function that I want to wrap in Python that has a
>> "std::vector<> &"argument. Is it possible to set the changes of the c++
>> object back to the python object? I have mapped this std::vector<> type
>> to a %MappedType, so I can implement %ConvertFromTypeCode and
>> %ConvertToTypeCode. It seems like for all ConvertFromTypeCode blocks
>> they create new objects, but how do I get the original Python Object
>> inside this block so I can change it? (I probably need to check to see
>> if its available first?)
> The nearest you can get is something like...
> void foo(std:vector<int> & /In,Out/);
> ...then in Python...
> lst = foo(lst)
That's good to know. This is very similar to what I used as a
More information about the PyQt