Here's my code:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. MyWidget myWidget;
  5. return a.exec();
  6. }
  7.  
  8. MyWidget::MyWidget()
  9. {
  10. ...
  11. show();
  12. do_heavy_init();
  13. }
To copy to clipboard, switch view to plain text mode 

As above, "a.exec();" is called after "do_heavy_init();".
Because "do_heavy_init()" costs much time, the main window would not show up immediately.
In my case, I actually want "do_heavy_init()" to be called after myWidget is shown up on the screen. Is there an elegant way to do so? Many thanks~