Generally using Signal slots seem to be the best approach, but for quick and dirty way to just update something on the UI, we can use QApplication.invokeLater and invokeAndWait methods. An example code snippet is below.
public void run() {
QTableWidgetItem item = new QTableWidgetItem("hello");
ui.tblStats.setItem(0,1, item);
}
});