When I do qmake -project;qmake;make on a project containing files with the Q_OBJECT macro, I get something like this:
moc_qtrackingbutton.cpp:80: error: redefinition of ‘void QTrackingButton::mouseMoved()’
qtrackingbutton.h:23: error: ‘void QTrackingButton::mouseMoved()’ previously defined here
make: *** [moc_qtrackingbutton.o] Error 1
I've searched the internet a bit, and apparently putting the member functions in a different file to the class definition works. I did this, but it gave me "undefined reference to `vtable for classname'", until I moved these files out of the directory, then did qmake -project;qmake, then moved them back in for the final make. This is neither elegant nor convenient. Is there any way around, other than that?