PDA

View Full Version : Is there a 'pureindex' for treeWidgetItems added to a simple treewidget ?



tonnot
21st July 2011, 18:41
If I add items to a tree, no matter where parent I was using, I have 1,2,3, n items added.
Can I have access to an item of a tree using simply this 'pure' index ?
Thanks.

ChrisW67
21st July 2011, 23:06
No. Nothing stops you maintaining a parallel QList of QPersistentModelIndexes which might provide something like this for small numbers of items (maintaining persistent indexes has peformance impacts). You could also maintain your own list of pointers to the QTreeWidgetItems if using the tree widget. There is no obvious natural order for this list: insertion order, top-to-bottom depth first, top-to-bottom breadth first...