In the Calculator example the argument is passed the script like
QScriptValue ctor = engine.evaluate("Calculator");
QScriptValue scriptUi = engine.newQObject(ui, QScriptEngine::ScriptOwnership);
QScriptValue calc = ctor.construct(QScriptValueList() << scriptUi);
QScriptValue ctor = engine.evaluate("Calculator");
QScriptValue scriptUi = engine.newQObject(ui, QScriptEngine::ScriptOwnership);
QScriptValue calc = ctor.construct(QScriptValueList() << scriptUi);
To copy to clipboard, switch view to plain text mode
This doesn't work
QScriptValue ctor = engine.evaluate("foo");
QScriptValue scriptObj = engine.newQObject(myScriptValueObject.toObject(), QScriptEngine::ScriptOwnership);
QScriptValue calc = ctor.construct(QScriptValueList() << scriptObj);
QScriptValue ctor = engine.evaluate("foo");
QScriptValue scriptObj = engine.newQObject(myScriptValueObject.toObject(), QScriptEngine::ScriptOwnership);
QScriptValue calc = ctor.construct(QScriptValueList() << scriptObj);
To copy to clipboard, switch view to plain text mode
I cannot find the syntax and playing with the code I am unable to figure out how to pass a QScriptValue as an argument to a script.
EDIT: and past that how to pass both the ui and the script object.
Bob
Bookmarks