[Development] Why is QSignalSpy using Qt::DirectConnection?

Thiago Macieira thiago.macieira at intel.com
Fri Oct 24 19:27:37 CEST 2014

On Friday 24 October 2014 19:06:39 Roland Winklmeier wrote:
> > QSignalSpy::wait() isn't thread-safe because it's using QTestEventLoop
> > instead
> > of a regular QEventLoop. That former does use a timer and, unlike the
> > latter,
> > you can't stop the loop from outside the loop's own thread.
> That was indeed the origin of the warnings. They appeared after introducing
> lines with QSignalSpy::wait().
> I suspected a bug in Qt, because my derived QObject did not start any
> timers and was actually pretty empty. It has only 2 dummy methods which
> trigger two different signals. I'll have a look QTestEventLoop then.

If you aren't able to find fixes, please at least submit a doc fix for 
QSignalSpy::wait() warning that it isn't thread-safe and won't work with 
signals emitted from other threads.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Development mailing list