QJsonModel

From Qt Wiki
Jump to navigation Jump to search

QJsonModel is a Qt/C++ model based on QAbstractItemModel. Usin this class, you can display json data into a QTreeView. The code is avaible on github QJsonModel as MIT license. You just have to copy QJsonModel.h and QJsonModel.cpp into your project.

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