头文件:
```cpp
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_PinnacleAPITool.h"
typedef struct ST_APINode
{
QString name = QString("");
QString description = QString("");
ST_APINode* childNode = nullptr;
ST_APINode* nextBrotherNode = nullptr;
} APINode;
class QTreeWidgetItem;
class QListWidgetItem;
class PinnacleAPITool : public QMainWindow
{
Q_OBJECT
public:
PinnacleAPITool(QWidget* parent = Q_NULLPTR);
protected slots:
void on_importBtn_clicked();
void on_searchBtn_clicked();
void SlotListWidgetItemClicked(QListWidgetItem* item);
void SlotTreeWidgetItemSelected(QTreeWidgetItem* item, int column);
protected:
void ClearData();
void ClearTreeItems();
void ClearListWidgetItems();
void RemoveNode(APINode* node);
bool LoadJsonData(const QString& fileName);
void AddChildNode(QJsonObject& jsonObj, APINode* node);
void CreateTree();
void CreateTreeNode(QTreeWidgetItem* treeItem, APINode* node);
private:
APINode* m_APIRootNode = nullptr;
std::vector<QTreeWidgetItem*> m_vecTreeitem;
std::map<QTreeWidgetItem*, QString> m_mapTreeItemToDescription;
std::map<QListWidgetItem*, QTreeWidgetItem*> m_mapListItemToTreeItem;
private:
Ui::PinnacleAPIToolClass ui;
};
cpp文件:
```cpp
在这里插入代码片
#include "PinnacleAPITool.h"
#include<QFileInfo>
#include<QFileDialog>
#include<QFile>
#include