You mustn't store QModelIndexes but you would have to store expensive QPersistentModelIndexes. Anyway, instead of storing edited model index to the delegate, I'd make the delegate aware of the view (parent) and check if QAbstractItemView::state() corresponds to QAbstractItemView::EditingState and QAbstractItemView::currentIndex() corresponds to the passed QModelIndex parameter.
PS. It seems that QListView is the only view which actually sets QStyle::State_Editing.





Reply With Quote
Bookmarks