After inserting a row in a QAbstractTableModel subclass, the QTableView will not display the new record!
Unsolved
General and Desktop
-
The QAbstractTableModel subclass holds a vector of rows as its data source. When I insert a new row to the vector by inserting into the vector, like this:
auto tmp = this->rows[row]; this->rows.insert(this->rows.begin() + row, tmp);
the QTableView does not display one more row!!
I tried emitting the DataChanged() signal but no success...
-
See QAbstractItemModel - Subclassing. To add a row to an existing model, QAbstractItemModel::beginInsertRows() and endInsertRows() must be called. dataChanged() is used to announce changes to existing cells.