You don't put your code "in" the main loop. The loop is implemented inside the application's exec() call. It waits for events and processes them. Such event can be a timer timing out or a queued slot invocation. The point is to not create a while loop (or similar) in your code as this prevents events (such as redrawing widgets) to be executed.
Bookmarks