Quote Originally Posted by Twey
But the files were headers.
Also, yop, when the second button in your code (b2) is connected to the moused() slot, nothing happens.
Sorry, I've confused this thread with another one.

The problem is that you have placed code in header files. You can only put declarations, templates and inline functions there (unless you want linking errors). Compiler doesn't have to know anything about .h files --- preprocessor creates a single .cpp file with all headers inside it and then it feeds such file to compiler.

In this case compiler put code of those methods in both moc_qtrackingbutton.o and app4lin.o, because both moc_qtrackingbutton.cpp and app4lin.cpp include qtrackingbutton.h.