Documentation error "qdoc can't run; no project set in qdocconf file"

Viewed 442

I am trying to generate documentation for my code using QDoc. qtdoc command is already in my environment variable path. But when I try to run the command in the root directory of the project (qdocconf file also resides in project root),

qdoc projectname.qdocconf 

I get the following error

qt.qdoc: "qdoc can't run; no project set in qdocconf file"

Here is my projectname.qdocconf file.

headers.fileextensions  = "*.h *.hpp"
sources.fileextensions  = "*.cpp *.qml *.qdoc"

outputdir   = Documentation/Code
headerdirs  += Code
sourcedirs  +=  . \
                Code
exampledirs = .
imagedirs   += ./Images/icons \
                ./Images/logos

I have commented on my class functions as described in the documentation using the format

/*!
 * \fn void inlineFunction()
 *
 * Some info here...
 */

Can you point me what am I doing wrong?

Also, can I create the documentation using QtCreator instead of running the command in terminal?

1 Answers

Well somehow I figured out that you need to add the following line in your .qdocconf file

project = YourProjectName

which is not present in the minimum qdocconf file presented in https://doc.qt.io/qt-5/qdoc-minimum-qdocconf.html. Even though the above issue was resolved, a lot of other issues were encountered such as:

  1. While compiling, qt.qdoc: No include paths passed to qdoc; guessing reasonable include paths. For this you have to manually include all the source paths. Read: https://bugreports.qt.io/browse/QTBUG-67289
  2. Some comment tags, e.g. \return, \param, present in QtCreator are not recognized by QDoc

Option 2

Alternatively, look for Doxygen which is much easier to use and generate documents with a simple to use GUI. It also recognizes all the comment tags in QtCreator.

Update:

Doxygen plugins for Qt Creator doesn't work anymore as the support has expired. Use Doxygen GUI directly.

Related