[Qt-interest] Qt signaling smarts...

Arnold Krille arnold at arnoldarts.de
Tue Nov 24 20:01:25 CET 2009


On Tuesday 24 November 2009 19:20:41 Gordon Schumacher wrote:
> Thiago Macieira wrote:
> > You can always make the middle-man signal be a direct connection:
> >
> > connect(&myQThread1,SIGNAL(thread1Signal()),
> > this,SIGNAL(thread1SignalToThread2Signal(), Qt::DirectConnection)
> 
> *blink*
> 
> So, that would be why the sender() docs warn you about threaded
> DirectConnection... when I read that, I went "why the heck would you do
> such a thing... bad juju!"  I guess as long as you're not actually
> accessing any data - as with this example - that would be safe!

I think here it is safe provided that thread1SignalToThread2Signal is only 
connected to slots/signals in thread2 via QueuedConnections. Once 
thread1SignalToThread2Signal is connected to other slots in main-thread or in 
a third thread, all hell breaks loose...

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091124/d307101e/attachment.bin 


More information about the Qt-interest-old mailing list