Hello,

I'am using QTreeView with a QAbstractItemModel derived model class. In some cases the underlying data will be changed (row remove from childlist) from other part of my application and after this the model signal layoutChanged is emitted.

If the removed row was selected prior and layoutChanged was called, the tree will be displayed correct but if i call currentIndex().internalPointer() from treeview the returned item will point to the removed item.

According to the docs (http://doc.qt.nokia.com/4.7/qabstrac...l.html#details) I thought that a rebuild of view and modelindex will be completed:
If the structure of the underlying data changes, the model can emit layoutChanged() to indicate to any attached views that they should redisplay any items shown, taking the new structure into account.
Can someone give me a hint to fill the gap in my mind?