This is the Qt Example for a "Simple Tree Model" but converted to using a QML TreeView
instead of a QTreeView widget.
It is using a QAbstractItemModel
to represent the tree model.
Here you can find the original example: http://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html