[Solved] About QCoreApplication::flush ()
I wanted to know what QCoreApplication::flush () does?
When is it used & why?
An example would be really helpful to understand.
I am using a GUI QApplication, so is that of any help to me?
Why didn't you read the documentation for "flush":http://qt-project.org/doc/qt-4.8/qcoreapplication.html#flush ?
I read, but I could not understand what was written.
That is why asked.
It is used when you want to flush a queue of events to be called immediately. Splash screen is the best example.
What exactly do you mean by "flush"?
From what I can understand it is something similar to processEvents() right?
If yes then what is the difference?
Yes. Only that flush does this for all pending events at once while processEvents handles them one by one
ok. Thanks for the answer.
What it really does is, it calls qApp->sendPostedEvents(), see https://bugreports.qt.io/browse/QTBUG-33489