I've created a QScriptEngine and exposed an object's function I can call from js script.
engine->globalObject().setProperty("obj", myObj);
myObj is a QObject that has a function like...
void MyObject::doSomething(int w, int h) {
...
}
and in my js code, I can call it like...
obj.doSomething(5, 9);
This works as I expect it would, but I can't find any docs on passing arrays or dictionaries to these functions. For example, if I wanted to pass an array, how would I define the C++ function so I could do something like this...
obj.doSomething([1,2,3], "foo");
Would that be something like...
void MyObject::doSomething(QVector<QVariant> firstArg, QString secondArg);
It's hard to work it out as it when it doesn't work, the call seems to silently fail.