In some Qt examples, I see they use
QTimer::singleShot(0, this , SLOT(funcA())), why not to call the slot funcA directly? also the same question f
Every system has a event loop where events are processed. Say like
application::processEvents()
{
// process event list..
}
Now the place where you write QTimer::singleShot(0, this, SLOT(doSomething())); might be inside some processing event.
When this loop is done, processEvents will be called again and in that the doSomething() will be executed.
So this is like calling doSomething in the next event loop, rather than calling it immediately. Hope you get the idea.