[Qt-interest] Synchronous signals, is that possible?
R. Reucher
rene.reucher at batcom-it.net
Sun Feb 15 16:03:07 CET 2009
On Sun February 15 2009 15:57:39 R. Reucher wrote:
> On Sun February 15 2009 14:28:51 Andrea Franceschini wrote:
> > The dilemma is that I really love the elegance and logical abstraction
> > provided by signals and slots and, unless there's a way to make them
> > work in a synchronous fashion, I'll have to directly pass the pointers
> > to my application, and that's frankly quite ugly.
> >
> > Ideas?
>
> You could use a "directly connected" signal instead.
>
> Qt::DirectConnection:
> When emitted, the signal is immediately delivered to the slot.
>
> See
> http://doc.trolltech.com/4.4/qobject.html#connect
> http://doc.trolltech.com/4.4/qt.html#ConnectionType-enum
Hmmm, reading what Qt::AutoConnection means I now see that when the sender
thread is the same as the reciever thread, this should already be the
default... so it would only change the situation on multi-threaded apps. And
it's questionable if "immediatly" in fact means "synchronously" anyway.
--
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/
Nearly all men can stand adversity, but if you want to test a man's
character, give him power.
-- Abraham Lincoln
More information about the Qt-interest-old
mailing list