Check the QAbstractItemModel docs.
#1 You can just emit layoutAboutToBeChanged() and layoutChanged().The view will then update itself thoroughly.
#2 If you are inserting/removing/moving items.Check the protected function.
example:
After calling this function,the view will also update itself.Qt Code:
void MyModel::removeOneRow(int index) { beginRemoveRows(xx); ...//Do the remove action here. endRemoveRows(xx); }To copy to clipboard, switch view to plain text mode
#3 If you want to update a range of item.Check the dataChanged(xxx) signal.
Bookmarks