Or this, as mentioned in my response:
Qt Code:
  1. void MyMainWindow::MyMainWindow(...)
  2. {
  3. ...
  4. QTimer::singleShot(0, this, SLOT(showSomeStuffLater()));
  5. }
  6.  
  7. void MyMainWindow::showSomeStuffLater()
  8. {
  9. ...
  10. }
  11.  
  12. // then
  13.  
  14. ...
  15. MyMainWindow *w = new MyMainWindow(...);
  16. w->show();
  17. ...
To copy to clipboard, switch view to plain text mode 
The slot will be called as soon as the program returns to the event loop after executing show() (and whatever follows it).