source: calamares/trunk/fuentes/src/libcalamaresui/utils/qjsonitem.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 1.0 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   SPDX-License-Identifier: GPL-3.0+
4 *   License-Filename: LICENSES/GPLv3+-QJsonModel
5 */
6
7#ifndef JSONITEM_H
8#define JSONITEM_H
9#include <QtCore>
10#include <QJsonValue>
11#include <QJsonArray>
12#include <QJsonObject>
13class QJsonTreeItem
14{
15public:
16    QJsonTreeItem(QJsonTreeItem * parent = 0);
17    ~QJsonTreeItem();
18    void appendChild(QJsonTreeItem * item);
19    QJsonTreeItem *child(int row);
20    QJsonTreeItem *parent();
21    int childCount() const;
22    int row() const;
23    void setKey(const QString& key);
24    void setValue(const QString& value);
25    void setType(const QJsonValue::Type& type);
26    QString key() const;
27    QString value() const;
28    QJsonValue::Type type() const;
29
30
31    static QJsonTreeItem* load(const QJsonValue& value, QJsonTreeItem * parent = 0);
32
33protected:
34
35
36private:
37    QString mKey;
38    QString mValue;
39    QJsonValue::Type mType;
40
41    QList<QJsonTreeItem*> mChilds;
42    QJsonTreeItem * mParent;
43
44
45};
46
47#endif // JSONITEM_H
Note: See TracBrowser for help on using the repository browser.