PDA

View Full Version : Can we make the signal calls synchronous??



yogesh
11th March 2009, 08:29
Hi,
I have a query is whether can we make a signal call to be synchronous?
Well the case is I am using QAbstractSocket API of waitForReadyRead(int msecs)
which returns true or false based on whether there was an error in socket or timeout has happened. Actually if I have connected the error() of Socket then in case this API times out then the control goes to the error(since error signal from Socket class has been emitted) but I need to get the value as true or false in the API itself else I have to write a really complex logic for controlling the code flow. Is it possible to make it sort of synchronouse that the control doesnt go to the slot.

Regards,
Yogesh

wysota
11th March 2009, 10:37
Signals are neither synchronous nor asynchronous. It's the slots that might be one of the two. Slots are by default synchronous when the object emitting the signal and the object having the receiving slot both live in the same thread.