Hy,
I've got a tree with cycle in it, and I would like to represent it in Qt, how can I ?
Because the parent for a QModelIndex is not always the same, so how can we handle it ?
Thanks
Hy,
I've got a tree with cycle in it, and I would like to represent it in Qt, how can I ?
Because the parent for a QModelIndex is not always the same, so how can we handle it ?
Thanks
A tree by definition has no cycles If you want to represent a graph, you won't be able to show it in one of the standard views anyway, so the implementation of parent has less meaning. Just return a proper parent index for the item, if it has two parents, return always the same one. There is a chance it will work although be aware the architecture was not built for such uses. It might be better to store the data as a neighbourhood matrix or not to use itemviews at all.
weepdoo (9th December 2008)
Thanks for the tips.
I'm going to doing it manualy
Bookmarks