If the goal is to use the model in more than one view, then do not use a QTableWidget but a QTableView. The model always maintains the indexes. The view might keep a list of indexes to store view specific parameters (like expanded items), but if the view wants to change an item, it needs to tell the model about it.
The description of qVariantFromValue:
http://doc.qt.nokia.com/4.7/qvariant...riantFromValue




Reply With Quote

Bookmarks