Qt Json Tree Model
Go to file
Evgeny Shtanov 47dea3309f Qt code style
In Qt6 Q_DECL_OVERRIDE is deprecated too.

Signed-off-by: Evgeny Shtanov <shtanov_evgenii@mail.ru>
2022-06-17 23:32:58 +03:00
.gitignore init repo 2015-01-22 08:24:08 +01:00
LICENSE change license to MIT 2017-01-04 01:13:57 +01:00
main.cpp Qt code style 2022-06-17 23:32:58 +03:00
qjsonmodel.cpp Qt code style 2022-06-17 23:32:58 +03:00
qjsonmodel.h Qt code style 2022-06-17 23:32:58 +03:00
QJsonModel.pro Fix QJsonModel.pro 2018-03-21 16:49:28 -03:00
qjsonmodel.py Add QJsonModel.clear 2020-10-21 00:14:19 +08:00
README.md Add instructions for installation of dependencies 2018-05-06 21:04:18 +09:00
screen.png change license to MIT, make code simple, add C++11 feature 2017-01-06 19:53:45 +01:00

QJsonModel

QJsonModel is a json tree model class for Qt5/C++11/Python based on QAbstractItemModel. QJsonModel is under MIT License.

QJsonModel

Usage C++

Add qjsonmodel.cpp and qjsonmodel.h into your project.

QJsonModel * model = new QJsonModel;
QTreeView * view = new QTreeView;
view->setModel(model);
model->load("example.json")

Usage Python

Add qjsonmodel.py to your PYTHONPATH.

$ pip install Qt.py
import json
import qjsonmodel

model = QJsonModel()
view = QTreeView()
view.setModel(model)

with open("example.json") as f:
	model.load(json.load(f))