There are some boilerplate codes in core elements. How could be those code fragments generated automatically?
Use some kind of annotation? Write .moc.h files with those annotation and convert them automatically to the real .h files as the first step of compiling.
First steps: Please check the attached codes.