[Interest] Waiting for specific signal from another thread.

Thiago Macieira thiago.macieira at intel.com
Sat Nov 10 16:38:17 CET 2012


On sábado, 10 de novembro de 2012 18.08.27, Igor Mironchik wrote:
> I need some functionality to wait for a specific signal was emitted from 
> another thread.
> 
> I have QObject that works on his thread. From another thread I 
> asynchronously provoke some method in this QObject. And then I need 
> blocking mechanism that will wait untill this QObject will emit some 
> signal. And I need to be sure that all connected to this signal slots 
> were worked.
> 
> How to implemet this in Qt? Any ideas?!

QEventLoop loop;
loop.connect(thatObject, SIGNAL(theSignal...), SLOT(quit());
loop.exec();

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121110/07b5221e/attachment.sig>


More information about the Interest mailing list