This this tutorial: "Multithreading PyQt5 applications with QThreadPool" in "PyQt5 Tutorial / Threads & Processes"
URL: www.pythonguis.com/tutorials/multithreading-pyqt-applications-qthreadpool
in class WorkerSignals(QObject):, we define progress = pyqtSignal(int).
in class MainWindow(QMainWindow): in def execute_this_fn(self, progress_callback):, we emit the signal progress_callback.emit(n*100/4).
However, n*100/4 is float. We must emit the correct type, i.e. int(n*100/4), or the signal will be converted to a random number.
This this tutorial: "Multithreading PyQt5 applications with QThreadPool" in "PyQt5 Tutorial / Threads & Processes" URL: www.pythonguis.com/tutorials/multithreading-pyqt-applications-qthreadpool
in
class WorkerSignals(QObject):
, we defineprogress = pyqtSignal(int)
. inclass MainWindow(QMainWindow):
indef execute_this_fn(self, progress_callback):
, we emit the signalprogress_callback.emit(n*100/4)
. However,n*100/4
isfloat
. We must emit the correct type, i.e.int(n*100/4)
, or the signal will be converted to a random number.