from http://doc.trolltech.com/4.2/porting4.html#qapplication
The guy, posting the above code probably is using Qt-3.* whereas you are using Qt-4.*.QApplication::setMainWidget() is no longer used. When all an application's windows are closed, the application will exit normally.
Bookmarks