You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
heximing
added a commit
to heximing/PyQt-GUI-demo
that referenced
this issue
Apr 23, 2024
pyqtSignal() must pass the correct type, or the signal emitted would be converted to random numbers.
See this issue:
github.com/pythonguis/feedback/issues/7
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)
.in
class 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.The text was updated successfully, but these errors were encountered: