PDA

View Full Version : Error--High Priority



sujan.dasmahapatra
5th February 2009, 11:46
Dear Friends...
I am getting an error as
MainWindow::MainWindow(QMainWindow *):
:Undefined reference to vtable for MainWindow

Could anyone please tell me what is the reason of this error..???

jpn
5th February 2009, 15:16
Make sure the Q_OBJECT macro is present in the definition of all QObject-derived classes.
Make sure you define your QObject-derived classes in your header files ONLY.
Make sure all of your header files are listed in your .pro file in the HEADERS= list.
Run qmake every time you add Q_OBJECT to one of your classes or modify your .pro file.

wysota
5th February 2009, 16:14
I will also add:

5. Make sure you implemented the constructor you had declared in the class header.

By the way, having a main window constructor that takes a QMainWindow as its parent is probably an error in design.