QApplication::setMainWidget() is a method from Qt3 whereas you seem to be using Qt4.