Use eclipse to develop qt gui applications. If you want to customize a class, you need to use the signal/slot mechanism. Therefore, add it to the custom class.Q_objectMacro. However, an error is reported during build! Shape:
Undefined reference to vtable
I found the cause after checking on the Internet for a long time 《
Qt causes of "undefined reference to 'vtable"
, But the solution is too operability.
《
Undefined reference to 'vtable for 'Solution
The solution is informative, but not in the Eclipse IDE development environment.
So continue to search .....
In the 'undefined reference to vtable' when inheriting from qobjec
T found the solution:
If you are using qmake sometimes you have to delete all your makefiles
And regenerate them to get your new header file MOC 'ed
Therefore, right-click the Eclipse project and choose "Clean Project". All makefile files are generated again. Build again,No problem
.