I am trying to use QJSEngine to automate part of my application. I exposed the instance of QAction "viewsignals" to JSEngine and this code executes successfully:
QJSValue fun = myEngine.evaluate("(function(a, b) { viewsignals.trigger();}");
QJSValueList args;
args << 1 << 2;
fun.call(args);
QJSValue fun = myEngine.evaluate("(function(a, b) { viewsignals.trigger();}");
QJSValueList args;
args << 1 << 2;
fun.call(args);
To copy to clipboard, switch view to plain text mode
Next, I am trying to add "alert" to the function:
QJSValue fun = myEngine.evaluate("(function(a, b) { viewsignals.trigger(); alert('completed');}");
QJSValue fun = myEngine.evaluate("(function(a, b) { viewsignals.trigger(); alert('completed');}");
To copy to clipboard, switch view to plain text mode
However, when executed, alert does not show up.
What am I doing wrong here?
Thanks
Bookmarks