QJsonModel

From Qt Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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")