Should I use QCoreApplication::processEvents() or QApplication::processEvents()?
Neither, processEvent() should be calld only when you have actual pending events to process. You may find this useful : How to make Qt work when main thread is busy?
You'll be much better off moving the long-running process out of the main thread so you don't need to call processEvents()
. Within that long-running process, you can emit whatever signals you need so the gui has sufficient information to do updates, etc. processEvents
, however, is usually a crutch for a poor design.