QAbstractTableModel *myModel = new QAbstractTableModel(this);...QTreeView treeView = new QTreeView;treeView->setModel(myModel);treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);...
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) cons{ return createIndex(row, column);}QModelIndex parent(const QModelIndex &index) const{ return QModelIndex();}
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) cons{ return parent == QModelIndex() ? createIndex(row, column) : QModelIndex();}