Q_SIGNALS and Q_SLOTS were introduced in Qt 4.1 as alternate to the keywords signals and slots, to enable compatibility with the boost library:
http://trolltech.com/developer/notes/changes/changes-4.1.0/
Anyway thanks for the pointer to StdAfx.h. I added these lines and it works now:
#define slots
#define signals public
#define Q_SLOTS
#define Q_SIGNALS public