Why would you like to add to the layout after the widget is after the dialog is shown?
In your particular case everything will happen so fast you won't see the "empty" dialog anyway.
If you really need to show half of the dialog and the rest sometime after, you can add all the widgets to layout and specifically hide the ones you don't want and then show them later.
And follow stampede's advice and create widgets on the heap.
//your code doesn't crash on Windows with Qt 4.7.2 - i can't test on Linux at the moment
Bookmarks