How to update a model so it refreshes all its views?
Unsolved
General and Desktop
-
I have a QAbstractTableModel subclass and i want to tell the model that it has been modified so that all its views are refreshed. Currently I have this trick which refreshes but it only refreshes one QTableView:
model->setData(insertIndex, QVariant(-1), Qt::EditRole); ui.tableView->setCurrentIndex(insertIndex);
There must be a more general method at the model level!
-
Your class implementation of, for example, QAbstractItemModel::setData() should emit the dataChanged() signal. It is all fairly well described in subclassing.