I was wondering, all of the call() methods that i see in PythonQt and PythonQtObjectPtr return QVariant. Do I need to go into the <Python.h> interface to get a PyObject* and then wrap that in a PythonQtObjectPtr? Or is there a way to get a reference to an object returned by a callable from PythonQt?
Or is there a way to convert the returned QVariant into a PythonQtObjectPtr?
this example maybe helpful.
One of the constructors of PythonQtObjectPtr takes a QVariant, and if that holds a PyObject*, the PythonQtObjectPtr takes ownership of it. So you can simply write:
PythonQtObjectPtr result = module.call("func", …);
'result' is a wrapped Python object, so you can do: result.getVariable(), result.call(), etc.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.