Are you using a QProgressBar or a QProgressDialog? The former needs to be created, placed into a layout and shown before it is visible; the latter provides all that infrastructure for you by placing the progress bar into a dialog.
You probably won't need to call processEvents, but if you do you don't want to call it any more often than is necessary to ensure timely progress bar updates. It's impossible to tell from the code sketch you provided where this should be - it could be just inside the while loop, just inside the outermost for loop, in the innermost for loop, or perhaps when the value of counter modulus some number equals zero. But you certainly don't want to call it every time counter gets incremented.
Bookmarks