[Interest] Queued signals lost in 5.15.0 (works in 5.12.5) (Windows)

Rainer Wiesenfarth rainer_wiesenfarth at trimble.com
Thu Sep 24 17:55:54 CEST 2020


Hi all,

the topic is Qt on Windows, versions 5.15.0 vs. 5.12.5, connections made
with Qt::QueuedConnection, event loop of a worker thread.

I have a strange problem that for a certain queued signal/slot connection
the signal is emitted, but the event does not reach the connected slot.
This problem is reproducible in Qt 5.15.0, but does not occur in Qt
5.12.5. *Unfortunately,
the simple test program (see attached file) does not show the behavior.*

Any ideas or ringing bells?

Some details:
- GUI application with a worker thread that is running its own event loop
- QObjects of type "Job" and "Worker" all are running in the worker thread
context
- signal Job::done() is connected to Worker::invokeNext() using
Qt::QueuedConnection [1]
- for most classes JobDerived this mechanism works, Job::done() creates the
event and the worker thread's event loop picks it up and calls
Worker::invokeNext()
- for one class JobDerivedFaulty the mechanism fails. As far I could
understand the depths of Qt, the event is created and posted to the event
loop, but when the event loop does the next iteration, the event is not
found and Worker::invokeNext() is not called - in my case this leads to a
stalled application, as the worker thread never finishes.
- if I take the application built and running without this issue with Qt
5.12.5 and replace the DLLs with those from Qt 5.15.0, the issue appears.
That means there is a change in the event handling between 5.12.5 and
5.15.0 that causes the issue to appear.

[1] the queued connection is a requirement raised by the given
architecture; Worker::invokeNext() should not be directly called by
Job::done()

Cheers, a puzzled Rainer

-- 
Software Engineer | Trimble Imaging Division
Rotebühlstraße 81 | 70178 Stuttgart | Germany
Office +49 711 22881 0 | Fax +49 711 22881 11
http://www.trimble.com/imaging/ | http://www.inpho.de/

Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim
Eingetragen beim Amtsgericht Darmstadt unter HRB 83893,
Geschäftsführer: Rob Reeder, Jürgen Kesper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200924/fa4fd51a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QtQueuedConnections.zip
Type: application/x-zip-compressed
Size: 2402 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200924/fa4fd51a/attachment.bin>


More information about the Interest mailing list