Let me answer my own question. I just realized that the installation of sources is too small. You also need to configure headerdirs.
headerdirs = ../sources
This solves the problem. Qdoc first looks for headers and then looks for .cpp files for documentation. qdoc does not search for documentation in header files, but header files are required to search for source files.