我一方面在 Qt Creator(7.0.1 和 Qt 6.2.3)上創建了一個 HMI 專案,另一方面通過 Visual Studio 創建了一個 C (C 20)庫。
第一步是為庫創建一個 Doxygen 檔案,現在使用 Doxyfile 組態檔運行良好。
接下來,我添加關于我自己的 HMI 類的檔案,在 Doxyfile 中添加源代碼路徑。它也可以作業,但我沒有指向 Qt 物件的鏈接(例如 QString,...)。
所以我修改了我的 Doxyfile 以在 TAGFILES 引數中包含我的 Qt 版本的所有標簽(例如:c:/Qt/Docs/Qt-6.2.4/activeqt/activeqt.tags=https://doc.qt.io/qt -6.2/ )。這樣做讓我確實擁有到 Qt 物件的鏈接,但也有很多我不想在我的檔案中看到的公共成員(例如:MainWindow 類的setToolButtonStyle方法。這是開始的快照(因為有成千上萬種不需要的方法):

如何從 Qt 物件中排除所有這些方法并只保留我自己的類的方法?
這是我的 DoxyFile:
PROJECT_NAME = "新超"
PROJECT_NUMBER = 1.0.0
PROJECT_BRIEF = "捕獲軟體 SDK 的新版本"
PROJECT_LOGO = ../i2SSDKLinear/LogoI2S_doc.png
OUTPUT_DIRECTORY = 輸出
INLINE_INHERITED_MEMB = 是
NUM_PROC_THREADS = 0
EXTRACT_ALL = 是
EXTRACT_PRIVATE = 是
輸入 = ../i2SSDKLinear \
../IHM/IHM_Test
IMAGE_PATH = ../i2SSDKLinear
GENERATE_QHP = 是
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 = 是
GENERATE_TREEVIEW = 是
GENERATE_LATEX = 否
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 = 是
CALL_GRAPH = 是
CALLER_GRAPH = 是
DIR_GRAPH_MAX_DEPTH = 5
更新 1:找到一半的解決方案
準備一個例子來提供更多細節,我看到了一些關于INLINE_INHERITED_MEMB的東西,它將被設定為YES。將其設定為NO將解決一半問題,因為我不再直接顯示所有這些方法。但現在我有關于所有其他繼承成員的部分:

更新 2:源代碼示例
主視窗.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;
}
主視窗.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:找到解決方法
使用其他主題的解決方法。
uj5u.com熱心網友回復:
最終按照另一位用戶就該主題提出的解決方法找到解決方法。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/491180.html
上一篇:在PyQTGUI中繪制圖表
