Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
Qt Creator 2.2.0
-
None
-
verified in Windows 7 x64, Ubuntu x86_64
Description
When a class is changed from 'not inheriting from QObject' to 'inheriting from QObject', signal methods are not generated, leading to undefined vtable for XXX errors. The workaround is to update the .pro file's modification time manually ('touch <.pro file>' on linux, or add a space and save on windows, etc.).
To verify bug,
1) create new Qt project (Qt Gui is handy/quick)
2) add a new class to the project with no base classes
3) build project
4) edit class '.h' & '.cpp' to inherit from QObject (Q_OBJECT macro, proper constructor, some arbitrary signals/slots, and at least one 'emit SIGNAL_XXX')
5) without modifying anything else, rebuild the project
6) verify linking fails with "undefined reference to vtable for 'SIGNAL_XXX'..."
7) modify project .pro file ( add a space, delete the space, and then save )
8) without modifying anything else, rebuild project
9) verify that the project builds correctly now.
Proposed solutions
1) quick n dirty solution: the "clean project" or "rebuild project" action should update the .pro file's modification time
caveat, user still has to clean/rebuild project to link properly
2) optimal solution : add simple regular expression test of each file to detect relevant inheritance changes, and regenerate makefile as appropriate
Attachments
Issue Links
- is replaced by
-
QTCREATORBUG-231 Creator should know when to rerun qmake
-
- Closed
-