C++ (Qt)void ItemStorageTableModel::setItems(const ItemsList &newItems){ beginResetModel(); _itemsHash.clear(); foreach (ItemInfo *item, newItems) _itemsHash[qMakePair(item->row, item->column)] = item; endResetModel();}