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:
Qt Code:
  1. QJSValue fun = myEngine.evaluate("(function(a, b) { viewsignals.trigger();}");
  2. QJSValueList args;
  3. args << 1 << 2;
  4. fun.call(args);
To copy to clipboard, switch view to plain text mode 

Next, I am trying to add "alert" to the function:
Qt Code:
  1. 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