Hmmm, that's correct. But this changes nothing. It's still does not work.
If I understand it correctly, I have to do the mapping in both slots, but interestingly it works without this mapping the the rowsAboutToBeInserted() slot. I tried to remove the mapping from rowsAboutToBeRemoved() temporarily, but no change again.
Because I think it is correct to map it in both functions, I added the missing mapping to rowsAboutToBeInserted() too.
Now my rowsAboutToBeInsertedSlot() slot looks like:
void MergeProxyModel
::rowsAboutToBeInsertedSlot(const QModelIndex &parent,
int first,
int last
) {
const int offset = getOffset(smodel);
beginInsertRows(parent, first + offset, last + offset);
}
void MergeProxyModel::rowsAboutToBeInsertedSlot(const QModelIndex &parent, int first, int last)
{
QAbstractTableModel *smodel = qobject_cast<QAbstractTableModel *>(sender());
const int offset = getOffset(smodel);
beginInsertRows(parent, first + offset, last + offset);
}
To copy to clipboard, switch view to plain text mode
Would a small example application to test it, help?
Bookmarks