I have a QMainWindow that has a QTableView as its central widget.

The main window itself is exposed to script engine:
Qt Code:
  1. QScriptValue winValue = engine->newQObject(mainWin);
  2. engine->globalObject().setProperty("mainWindow", winValue);
To copy to clipboard, switch view to plain text mode 

Then, in my script, I try to find this child QTableView and call its public slot:
Qt Code:
  1. var view = mainWindow.findChild("tableView"); // The object name of QTableView is tableView
  2. view.selectAll();
To copy to clipboard, switch view to plain text mode 

My question is:
If the script engine is run in a different thread, then are the script functions such as findChild() and selectAll() thread-safe? How is this implemented in QScriptEngine internally?

There once was "QObject::connect: Cannot queue arguments of type 'QItemSelection'" error while evaluating "view.selectAll()". However, it disappears after I insert "qRegisterMetaType<QItemSelection>("QItemSelection ")" to the code.

The script does run as expected but I'm wondering if the error is actually solved or just hidden...