Qt training treeview-model invalid index
Unsolved
General and Desktop
-
https://github.com/qt-training/training-material/tree/master/widgets/demos/ex-tree-model
int ReadOnlyModel::rowCount(const QModelIndex &parent) const
{
Node *parentNode = nodeForIndex(parent);
return parentNode->children.count();
}In the web tuto of qt training they explain how to create Tree View using model and how to use drag and drop in the model. I have found the source code on github.
When I test the row count parent is always invalid and I don't know why, how to modify the source code for get a valid index ? Anybody have an idear please ?