title: Hierachical data in TreeViews and TreeView updating technique
body: <p>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:</p>
  
  <ol>
  <li><code>Item_A -&gt; Item_B -&gt; ItemC</code></li>
  <li><code>Item_B -&gt; Item_C</code></li>
  <li><code>ItemC</code></li>
  </ol>
  
  <p>Lets assume that <code>Item_A</code> contains <code>Item_B</code> which contains <code>Item_C</code> as it is shown above. This means that my list will also show the hierarchy of <code>Item_B</code> and <code>Item_C</code>. Consider now that something happens to an an object shown as <code>Item_B</code> (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? </p>
  
  <p>Thank you. </p>
  
  <p>PS: Programming language is C++, and GUI lib is QT3.</p>