Ok that clears things up a bit.
I did figure that the beingRemove/endRemove stuff was a protection mechanism, but I didn't realise it would always (at least in my case) cause a dataChanged to be emitted for the entire model. I had sort of thought that the redrawing would be smarter when using the more precise insert/remove operations rather than the more blunt beginResetModel/endResetModel, although I can see in this case that when you remove the first item(s) all other item's indexes are changed. Is it possible to have a model which doesn't have it's indexes starting at 0, so after the buffer is filled, on the next insertion, a new item would be added with an index one larger than the current last item, and all of the other indexes would remain the same, but there would no longer be an index 0?
I didn't quite follow this comment
bq. You might want to use the QTextEdit to display a number of lines. If the number of lines get to big set the overwrite function and set the insertion position back to 0?
are you talking about a different way of implementing this, because at the moment, I have a fixed size fifo, so the number of lines will increase to the size of the fifo then remain constant.
At any rate, I've fixed some bugs in my code and it does work correctly inserting rows until full, then doing a remove followed by an insert once full. Once the buffer is full, on a removal I take note of the top visible item, and adjust it for the number of lines being removed/inserted, and then use QTableView::scrollTo to ensure it is still the top item after the insertions are complete. This is a bit messy, but achieves the effect I desired. I guess this is the scenario which could be optimised though, where all the data on screen is unchanged, but will get redrawn on an insertion.
I think it's an interesting problem too, which is why I'm keen to discuss it. Thanks again for your thoughts on the topic.