'Variables types in PythonQt

I am using PythonQt to execute a Python script from a program in c++. To pass variables from c++ to the Python script, I can use this function:

void PythonQtObjectPtr::addVariable (const QString & name,
const QVariant & v 
)       

For example to pass a double type:

mainModule.addVariable(QString("variableName"), QVariant::fromValue(5.0));

Now I need to pass a variable that in Python is written like a matrix:

var = [[1, 2],[3, 4],[5, 6]]

How does it work in this case?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source