Unsolved QScriptValue of array nth element
I have big trouble getting the nth element of a QScriptValue array.
var a = [ o1, o2, o3 ];
Where o1..o3 are objects of arbitrary type.
Now I get the QScriptValue for this array:
QScriptValue v = engine.property("a");
Now, how do I retrieve (for example) object o2 given v ?
If a were an object, I could do a "v.property()", but a is an array and I'm stuck here ...
QScriptValue o2 = v.property("1");
because array indexes in JS are simply properties. The only thing is that you cannot write
a.1; // WRONG
you must write