Is signal-slot blocking.??
-
Not sure, are you asking if the constructor could block on processing a signal? I think this could happen if you have a multithreaded application (therefore signals are coming independently from the thread that is building the instance).
"This":http://developer.qt.nokia.com/doc/qt-4.8/threads-qobject.html could help. -
Can you please rephrase your question. It is completely incomprehensible (to me).
There is no way a slot connected in the constructor is execute before the constructor is finished, neither in single-threaded applications (the thread is executing your constructor) nor in multithreaded applications (the signal is dispatched as soon as the execution returns to the event loop, which happens in any case after the constructor has returned).
I see this only happening if you <code>qApp->processEvents()</code> or <code>moveToThread(this)</code> in your constructor - both highly questionable. Rule of thumb: just don't do it.
-
If the question is whether emitting a signal blocks the caller until the slots have been called, then the correct answer is "it depends".
In a single-threaded case, signal-slot connections are direct connections, meaning the slots get called when the signal is emitted (the signal function is called). The signal method returns after all connected slots have been called. In a multi-threaded case, it depends on whether the sender and receiver are associated with the same thread.
Have a look at http://doc.qt.nokia.com/4.7-snapshot/thread-basics.html for more details.