123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef INFOTREE_WGT_H
- #define INFOTREE_WGT_H
- #include <QWidget>
- #include <QTreeView>
- #include <QStandardItemModel>
- #include <QJsonDocument>
- #include <QJsonObject>
- #include <QJsonArray>
- #include <QFile>
- #include <QDebug>
- namespace Ui {
- class InfoTree_wgt;
- }
- class InfoTree_wgt : public QWidget
- {
- Q_OBJECT
- public:
- explicit InfoTree_wgt(QWidget *parent = nullptr);
- ~InfoTree_wgt();
- private:
- Ui::InfoTree_wgt *ui;
- QTreeView *treeView; // QTreeView 成员变量
- QStandardItemModel *model; // QStandardItemModel 成员变量
- QStandardItem* createTreeFromJson(const QJsonObject &jsonObject); // 用于从 JSON 创建树结构
- public slots:
- void show();
- };
- #endif // INFOTREE_WGT_H
|