title: Storing persistent information about items in view
body: <p>I've my own view based directly on <code>QAbstractItemView</code>.
  Generally speaking I need to store some information about particular model's item.</p>
  
  <p>So in my view I have a map from <code>QModelIndex</code> to struct describing partical item.
  Then I use those data mostly on view's <code>paintEvent</code>.</p>
  
  <p>The problem is, that QModelIndex is not persistent, it may get outdated.
  So when rows are inserted or removed from model, some <code>QModelIndex</code> may become invalid and I should not relay on them.</p>
  
  <p>How then can I build relation between item in model and some decoration data I use in view?</p>
  
  <p><code>QPersistentModelIndex</code> seems to be proper tool for such things, however I'm aware of its performance (my model and view may be huge).</p>
  
  <p>Another problem with <code>QPersistentModelIndex</code> is that it probably should not be used as map's key (as it is in my case) as it may (and will) change and make map inconsistent.</p>
  
  <p>I've took a look at Qt's implementation of QTreeView and QListView to see how they deal rows removal/insertion, but it seems they simply drop all the data.</p>
  
  <p>So at this point I cannot see any easy way to solve my problem.</p>