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