Did you run qmake after adding the Q_OBJECT macro to your class?