Since you put the Q_OBJECT code in the CPP file and not in a separate header it is not listed in HEADERS and therefore does not get the automated Metaobject compiler (moc) handling from qmake. You need to trigger qmake to generate moc pre-processing in the Makefile, and include the moc generated C++ source, an the easiest way to do that with a one-file-wonder is:
at the bottom of the main.cpp file and re-run qmake.
Normally the header for the QObject class would be in separate file listed in HEADERS. Then qmake ensures that moc is run, the resulting C++ code is compiled, and the result included in your linker run.
Bookmarks