我用一只手用Visual Studio用一只手,在QT Creator(7.0.1使用QT 6.2.3)上创建了一个HMI项目(7.0.1)。
第一步是为库创建Doxygen文档,该文档目前使用Doxyfile配置文件运行良好。
接下来,我添加有关我自己的HMI类的文档,并在Doxyfile中添加源代码路径。它也有效,但我没有链接到QT对象(例如QString,...)。
因此,我修改了我的doxyfile以在tagfiles paramater中包含我的QT版本的所有标签(示例: c:/qt/docs/qt-6.2.4/activeqt/activeqt/activeqt.tags = https://doc.qt。 IO/QT-6.2/)。这样做可以使我确实具有指向QT对象的链接,但也有很多我不想在文档上看到的公共成员(例如:MainWindow类的 settoolbuttonstyle 方法。开始的快照(因为有成千上万种方法):
我如何从qt对象中排除所有这些方法,仅保留我自己的类的方法?
这是我的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
<< Strong>更新1:找到一个准备示例以提供更多详细信息的解决方案
,我看到了一些有关 inline_inherited_memb 的东西,该将设置为是YES 因为我没有直接显示所有这些方法。
no 将解决问题的一半, /YFWN3.png“ rel =” nofollow noreferrer“> 
源代码示例
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
更新3:
使用另一个主题。
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) :

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:

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.
发布评论
评论(1)
最终,在另一个用户在。
Find a workaround finally following the workarounds proposed by another user on this topic.