[Interest] Interest Digest, Vol 96, Issue 29

Roland Hughes roland at logikalsolutions.com
Mon Sep 30 14:55:49 CEST 2019

On 9/30/19 3:51 AM, interest-request at qt-project.org wrote:
>> Anyway, DON'T use processEvents(). Redesign your code.
> It's unfortunately QScriptEngine which calls this method, triggered by a periodic timer. The application is Qbs and it is blackboxtest::concurrentExecution which triggers that behavior. It processes a long-running script that expects a file to appear in the file system produced by another thread. But for this to happen, the current execution thread needs to handle events. The testcase usually behaves as expected, but in rare cases it doesn't and that is what I am currently investigating.https://bugreports.qt.io/browse/QBS-1499  Before I suggest an action, I want to understand the error.

If you are "waiting for a file to appear" you should probably look into


>>> Sure, but I don't see a synchronization problem as long if
>>> QCoreApplication::processEvents() would do what the documentation says:
>>> executing pending events in the current thread. Am I misunderstanding
>>> something?

If you are relying on processEvents() you have a synchronization problem.

This application needs an architect.

>> Anyway, this is when you should use processEvents(): never.
> It is a public API and it is not marked as deprecated. If the function does not behave as documented, then either the documentation is wrong or the implementation has a bug or I am using it the wrong way. I don't think the latter is the case, but maybe I need a minimal test case to prove that.

Roland Hughes, President
Logikal Solutions


More information about the Interest mailing list