Hi,
I use QJSEngine and I want to add to the engine a method with variable arguments number.
I have added methods of C++ class "CustomScripts" with this code and it works fine, I can call myFunction.
CustomScripts * scriptObject = new CustomScripts;
QJSValue scriptTest = myQJSEngine->newQObject(scriptObject);
QJSValue aFunction = scriptTest.property("myFunction");
myQJSEngine->globalObject().setProperty("myFunction", aFunction);
CustomScripts * scriptObject = new CustomScripts;
QJSValue scriptTest = myQJSEngine->newQObject(scriptObject);
QJSValue aFunction = scriptTest.property("myFunction");
myQJSEngine->globalObject().setProperty("myFunction", aFunction);
To copy to clipboard, switch view to plain text mode
But exposed methods take only 1 or 2 arguments.
I try to use QVariantList to pass variable argument number but it only work for javascript array.
How can I do that ?
Bookmarks