title: Effective removing columns for QTreeView
body: <p>I use Qt 4.8.6. I have a custom tree model (based on <code>QAbstractItemModel</code>). Each node represents a computer node, it has a list of children and a list of operations. If computer node is not a leaf, then operation list is empty. This model is linked with <code>QTreeView</code>.  Computer nodes are located in the 0 column, each operation is depicted in a separate column, starting from the first one. Computer node can become unavailable, so I mark it in striked font and emit <code>dataChanged()</code>. But I also have to clear its operation list. What is effective way for it? I think that emitting <code>layoutChanged()</code> after <code>beginRemoveColumns()/endRemoveColumns()</code> is an overhead. AFAIK, removing/inserting columns should be done with root <code>QModelIndex</code>. So, what is the algorithm of removing columns in such situation? When I simply recalculated new total number of columns, called <code>beginRemoveColumns()</code>, removed inner data, called endRemoveColumns(), then the columns count in QTreeView was ok, but the cells in columns were blank for all computer nodes. Should I emit <code>dataChanged()</code> in cycle after that?</p>
  
  <p>Also I noticed that using proxy model (<code>QSortFilterProxyModel</code>) was a headache when you need to insert columns (at least). I suppose that <code>QSortFilterProxyModelPrivate::create_mapping</code> stores old values of row/column count. That is why using tree model directly works fine with <code>beginInsertColumns()/endInsertColumns()</code> pair, but including proxy requires emitting <code>layoutChanged()</code> after <code>beginInsertColumns()/endInsertColumns()</code> pair.</p>
  
  <p>Is emitting <code>layoutChanged()</code> after <code>endInsertColumns()</code> or <code>endRemoveColumns()</code> safe for persistent indexes?        </p>