An example QML application showing how to define a nested model in C++ and expose it to QML.
Instead of implementing a QAbstractItemModel, it uses QQmlObjectListModel.
The QQmlObjectListModel template class comes from: http://gitlab.unique-conception.org/qt-qml-tricks/qt-qml-models
Here you can also find some slides about it: https://docs.google.com/presentation/d/13pkRav2Fks_AKTXfKtGTyBuc_RmkZGiDRQZTr4usQFk/pub
And here is an alternative approach: https://github.com/benlau/qsyncable