Overriding QThread.run and calling the default implementation
maurizio.berti at gmail.com
Fri Jul 2 18:55:53 BST 2021
After some testing to dig deeper in the QThread subject, pushed by the
previous related thread, I found something I don't really understand (just
to add something more to the "you never stop learning").
Take the following simple example:
from PyQt5 import QtCore, QtWidgets
layout = QtWidgets.QVBoxLayout(self)
self.button = QtWidgets.QPushButton('start')
self.label = QtWidgets.QLabel('waiting')
self.worker = Worker()
app = QtWidgets.QApplication(sys.argv)
w = Test()
This results in freezing the whole application as soon as the thread is
Why does this happen? I believe it could be related to how threading works
and the whole wrapping, but I'm not sure and I'd like to understand the
reason for this anyway.
If instead of calling run() I call exec() (which is what run() actually
does), it works fine.
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt