Hello,

I am wondering if it's currently possible to call a python object's function and return PythonQtObjectPtr regardless of whether it's possible to convert it to, say, QVariantList.

My use case is rather straightforward. I want to create a numpy array and pass it as a return value from my slot. Right now to achieve this I need to write the code similar to the one below to avoid automatic conversion occurring in conversion from PyObject* to QVariant:

PythonQtObjectPtr getVectorAsNumPy() const
{
    auto numpyModule = PythonQt::self()->importModule("numpy");

   return PythonQtObjectPtr{ PythonQt::self()->callAndReturnPyObject(
        PythonQt::self()->lookupCallable(numpyModule, "array"), QVariantList{ QVariantList{ 0.0, 1.0, 2.0 } }) };
}

Is there a way to avoid such verbose code? Or should I just add a method a-la callAndReturnObjectPtr() to PythonQtObjectPtr itself?

Thanks,
Rostislav.