passing a numpy object to decorator creator
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
I have a c++ class
nPhysD
and I'm trying to have a creator based on a numpy array.Here is the wrapper defining the
new_
python creator takingPyObject
as argument:But the creator doesn't get called and from within () Python I get:
I tried by replacing
Pyobject*
withPyArrayObject*
but I get the same error.How do I do?
I will have to try that myself, it should work... It has to be PyObject pointer, since that is the name that is checked in PythonQt, so PyArrayObject will surely fail.
The following worked for me:
And I can call QtCore.QObject(somePythonObject). The important thing is that your method needs to return a new object, if it returns NULL you will get an error.
wow, I missed that you need to actually return something (I still belive ther's som magic behind the way pytohnqt scrapes the metasystem).
I did put
nullptr
to do some tests before returing a proper object.Now it works.
Thanks a million.