Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.8.0
-
None
Description
There seems to be a race condition preventing slots to be called immediately in 6.8. The code below works for all versions below I've tested, but with 6.8 the callback is never executed. Workarounds are moving the signal creation outside run(), or adding a sleep() to the end of task() (hence the assumption it's a race condition).
from PySide6 import QtCore, QtWidgets QtWidgets.QApplication() class Signal(QtCore.QObject): result = QtCore.Signal() def run(): signal = Signal() def task() -> None: print("task") signal.result.emit() def done() -> None: print("done") # never executes with 6.8 signal.result.connect(done) QtCore.QThreadPool.globalInstance().start(task) run()