Did you rerun qmake after you have added Q_OBJECT to myMainForm class?