I know that a lot of QtTestLib examples use this hack where they #include "filename.moc" at the bottom of their filename.cpp files to fool moc into processing them in addition to the other h files.