c++linuxqtdebianqdoc

qdoc ignores Qt data types and prints int instead


I tried to form documentation for my little C++ Qt project, but qdoc knows only local data types defined in my project. For example:

original code: QVariant CustomFileSystemModel::data(const QModelIndex &index, int role) const qdoc output: int CustomFileSystemModel::data(const int &, int) const

Maybe there is some problem with dependences, which I didn't notice by the moment. Could you help me resolve it, please?

This is the qdocconf file:

include(/usr/share/qt5/doc/global/qt-module-defaults.qdocconf)
include(/usr/share/qt5/doc/config/exampleurl-qtbase.qdocconf)

project = project-name
description = Test project documentation

depends = *

sourcedirs = .
headerdirs = .
imagedirs = .

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

outputdir = ./doc/
outputformats = HTML

HTML.stylesheets = style.css
HTML.headerstyles = "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"/>\n"

I tried to include paths:

include(/usr/share/qt5/doc/global/qt-module-defaults.qdocconf)
include(/usr/share/qt5/doc/config/exampleurl-qtbase.qdocconf)

and export all the required variables using console. Like

export QT_VERSION=5.15.2

and so on. But it didn't help


Solution

  • I added the line

    headerdirs += /usr/include/x86_64-linux-gnu/qt5/QtCore
    

    So, I was reading stackoverflow and figured out that qdoc reads .h files before making .cpp. As far as I understand qdoc couldn't find Qt .h files which I used in my project.

    So I typed in console:

    sudo find / -name "qdebug.h" 2>/dev/null
    

    And I found the place of debug file. So in my case it was in the next dir:

    /usr/include/x86_64-linux-gnu/qt5/QtCore