qt1.cpp:8: error: no matching function for call to `QApplication::setMainWidget(QMainWindow (&
())'
This is telling you that there's no setMainWidget() method in QApplication that takes a QMainWindow object as a parameter.
QApplication::setMainWidget(QWidget*)
That line is telling you that setMainWidget() takes a pointer to a QWidget as an argument, so you need to pass the address of a QWidget object (or one of a class that is derived from it, like QButton, QLabel for example) to that method.
You should have the Qt documentation on your system. On my machine, it's located in /usr/lib/qt-3.3.3/doc (but it might be different on yours). Have a look at the tutorial and the other stuff there (such as the class references).