class Form(QMainWindow): finished = pyqtSignal() updateProgress = pyqtSignal(int) # use Slot in PySide2 def __init__(self, parent=None): super(Form, self).__init__(parent) ... self.updateProgress.connect(self.ui.progressBar.setValue) def run_test(self): for i in range(100): per = i + 1 self.updateProgress.emit(per) ...
References
https://stackoverflow.com/questions/42682544/pyqt5-listwidget-add-list-items