/* === This file is part of Calamares - === * * Originally from QJsonModel * Copyright 2015, Sacha Schutz * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Calamares is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . */ #ifndef JSONITEM_H #define JSONITEM_H #include #include #include #include class QJsonTreeItem { public: QJsonTreeItem(QJsonTreeItem * parent = 0); virtual ~QJsonTreeItem(); void appendChild(QJsonTreeItem * item); QJsonTreeItem *child(int row); QJsonTreeItem *parent(); int childCount() const; int row() const; void setKey(const QString& key); void setValue(const QString& value); void setType(const QJsonValue::Type& type); QString key() const; QString value() const; QJsonValue::Type type() const; static QJsonTreeItem* load(const QJsonValue& value, QJsonTreeItem * parent = 0); protected: private: QString mKey; QString mValue; QJsonValue::Type mType; QList mChilds; QJsonTreeItem * mParent; }; #endif // JSONITEM_H