Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyqtSignal() must pass the correct type, or the signal emitted would be converted to random numbers #7

Open
heximing opened this issue Apr 23, 2024 · 0 comments

Comments

@heximing
Copy link

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant