Quote:
Originally Posted by capink
After testing some more, I think I found the culprit. The chain loop makes this call between actions:
Code:
QApplication.processEvents()
If I comment this out, the problem does not happen anymore. I don't know calling processEvents() leads to this?
|
You are diving deep into Qt event management.
The "normal" reason for calling that method is that you are doing something on the GUI thread that takes a *long* time, or that your code is on a separate thread without normal event management. Making the call forces processing of queued GUI events, but it is doing so in the middle of processing some other event.
My experience is that it is rare that such a call is needed, and if it is needed then it is often a programming error where long-running "jobs" are running on the GUI thread. One must ask:
- Is the processing really so long?
- If it is so long, should we fork a subprocesses or is the "fork a subprocess" cure worse than the disease?
- If it is so long, is there some way to chain the processing based on events, for example progress timers?