I have lots of (hierachical) data that I show in a TreeView (could be around 20K items or more, including children items). The peculiar problem with my data is that each object shown in the treeview can exist in many treeview items. What I mean by that is that I might have an hierarchy like this one:
Item_A -> Item_B -> ItemC
Item_B -> Item_C
ItemC
Lets assume that Item_A
contains Item_B
which contains Item_C
as it is shown above. This means that my list will also show the hierarchy of Item_B
and Item_C
. Consider now that something happens to an an object shown as Item_B
(e.g name change). Then of course both items
must be updated. Consider now thousands of items in the treeview with complex hierarchies. What strategy would you use to update the treeview? Speed is of course the main concern here but also ease of use and maintenance. Currently I hold internal mappings of list items to objects and vice-versa to find and update items quickly. Is that a correct strategy? By recreating the list after each update I can throw lots of code away, but I wouldn't know which item paths were expanded or collapsed. How could I solve this problem? Should I store expanded paths in an internal container?
Thank you.
PS: Programming language is C++, and GUI lib is QT3.