Reputation: 1026
Never used this class before. I inherited my class from it. How to correctly remove item and recalculate indexes? What do I need send with dataChange (what arguments will be in this signal)?
Upvotes: 0
Views: 4849
Reputation: 37597
To remove row from model:
void MyModel::operationToRemoveItemAtRow(int row) {
beginRemoveRows(QModelIndex(), row, row); // no parent, one row to remove
someListWhichHoldsDataForModel.removeAt(row);
endRemoveRows();
}
See documentation or this documentation.
Upvotes: 2