Ensure you run qmake.

If you want the .h and .cpp in the same file, add #include "filename.moc" to your cpp.