The show() method executes before the sleep() call. However, Qt will not act on the request to show the UI before it returns to the event loop, which is some time after the sleep() period. You can put:
after the call to show() to force immediate processing.
There is probably a better way to achieve what you want. What is the purpose of the delay? What do you want to do after the sleep period is done?
Other notes:
Line 2 and line 3 do the same thing.
You can use QTimer for platform independent timeouts.
Bookmarks