QJsonModel

From Qt Wiki
Revision as of 21:38, 4 April 2017 by Dridk2 (talk | contribs) (add QJsonModel)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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")