Home > Mobile >  Linked Qt documentation to own Doxygen documentation
Linked Qt documentation to own Doxygen documentation

Time:06-15

I created a HMI project on Qt Creator (7.0.1 with Qt 6.2.3) in one hand and a C (C 20) library through Visual Studio in the other hand.

The first step was to create a Doxygen documentation for the library, which is working well for now using a Doxyfile configuration file.

Next, I add the documentation about my own HMI class adding the sources code path in the Doxyfile. It is also working but I didn't have the link to the Qt object (such as QString, ...).

So I modify my Doxyfile to include all tags of my Qt version in the TAGFILES paramater (example: c:/Qt/Docs/Qt-6.2.4/activeqt/activeqt.tags=https://doc.qt.io/qt-6.2/). Doing this allowed me to have indeed the links to the Qt objects but also a lot of public members I don't want to see on my documentation (example: the setToolButtonStyle method of the MainWindow class. Here is a snapshot of the beginning (because there are thousands of methods unwanted) :

enter image description here

How can I exclude all these methods from the Qt object and keep only the methods of my own class ?

Here is my DoxyFile:

    PROJECT_NAME           = "NEW SUPRA"
    PROJECT_NUMBER         = 1.0.0
    PROJECT_BRIEF          = "The new version of the SDK for Capture software"
    PROJECT_LOGO           = ../i2SSDKLinear/LogoI2S_doc.png
    OUTPUT_DIRECTORY       = output
    INLINE_INHERITED_MEMB  = YES
    NUM_PROC_THREADS       = 0
    EXTRACT_ALL            = YES
    EXTRACT_PRIVATE        = YES
    INPUT                  = ../i2SSDKLinear \
                             ../IHM/IHM_Test
    IMAGE_PATH             = ../i2SSDKLinear
    GENERATE_QHP           = YES
    QCH_FILE               = ../MyDoc.qch
    QHP_NAMESPACE          = i2s.newSupra.1.0
    QHG_LOCATION           = C:/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/bin/qhelpgenerator.exe
    DISABLE_INDEX          = YES
    GENERATE_TREEVIEW      = YES
    GENERATE_LATEX         = NO
    GENERATE_DOCBOOK       = YES
    TAGFILES               = c:/Qt/Docs/Qt-6.2.4/activeqt/activeqt.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qdoc/qdoc.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qt3d/qt3d.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtbluetooth/qtbluetooth.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtconcurrent/qtconcurrent.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtcore/qtcore.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtgui/qtgui.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtlabsplatform/qtlabsplatform.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtnetwork/qtnetwork.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtnfc/qtnfc.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtpositioning/qtpositioning.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtprintsupport/qtprintsupport.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtqml/qtqml.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtquick/qtquick.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtquickcontrols/qtquickcontrols.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtscxml/qtscxml.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtsensors/qtsensors.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtserialbus/qtserialbus.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtsql/qtsql.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtsvg/qtsvg.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qttestlib/qttestlib.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtwebchannel/qtwebchannel.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtwebsockets/qtwebsockets.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtwidgets/qtwidgets.tags=https://doc.qt.io/qt-6.2/ \
                             c:/Qt/Docs/Qt-6.2.4/qtxml/qtxml.tags=https://doc.qt.io/qt-6.2/
    HAVE_DOT               = YES
    CALL_GRAPH             = YES
    CALLER_GRAPH           = YES
    DIR_GRAPH_MAX_DEPTH    = 5

UPDATE 1: Find half the solution

Preparing an example to give more detail, I saw something about the INLINE_INHERITED_MEMB which will be set to YES. Setting it to NO will resolve half the issue because I have not anymore all these methods directly shown. But now I have section about all additional inherited members:

enter image description here

UPDATE 2: Source code example

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    myFunction("test");
    ui->label->setText(str);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::myFunction(QString text)
{
    str = text;
}

mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void myFunction(QString text);
private:
    Ui::MainWindow *ui;

    QString str;
};

#endif // MAINWINDOW_H

UPDATE 3 : Workaround found

Using workarounds of this other topic.

CodePudding user response:

Find a workaround finally following the workarounds proposed by another user on this topic.

  • Related