slots with non const arguments and datatype mapping
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hi!
i want to implement a pyhton function in c++, using the available PythonQt wrapper in my C++ Application.
The functions takes a List (integers) as argument. The list is filled (modified) with integer inside the function by calling append.
If i now try to implement this in c++ with an decorator object calling the methods, the list is modified int the c++ context, but the slot argument seems not to be "retransfered" to Python, just the results (return value) of the slot seems.
So the slot behaves like "called-by-value"
Is this correct or do i make a mistake here?
The only way i found to change the argument is to pass it as pointer, but then i have to use a custom
type and cannot use normaly python lists any more
Since Python lists/tuples are converted to QList<int>, call by value is the only way to go and there is no automatic way to use call by reference.
But you can modify the list in C++ and return the modified list as return value of the slot.