QJsonModel: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(add QJsonModel)
 
(No difference)

Latest revision as of 21:38, 4 April 2017

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