Greetings.

I really hope i can find an answer here.

I have the following problem:
A worker thread is feeding data at a high rate to my main(gui) thread. I add the data to my model per row (i receive a structure which contains the data of an entire row). I use the beginInsertRows and endInsertRows functions.
In my view i have reimplemented rowsInserted, so i have control when to update the view. I.e. if the data is not actually visible, then the viewport should not be updated, otherwise the result will be that the cpu is constantly at 100%.
The problem is the following:
Although this quite visibly solves the high cpu usage, it also has the following undesirable effect:
It doesnt update the vertical scrollbar. For example, lets say in my view i can fit 10 rows, visually. From the 11th onward, the scrollbar doesnt resize itself. If i sort, filter, etc., the scrollbar resizes to represent the number of the rows at that moment, but it doesnt resize afterwards.

I have tried updating manually the scrollbar. Unacceptable jittery results.
In conclusion, i need a solution, that *always* updates the vertical scrollbar, but it doesnt try to update the view if the added item is not visible.

Thank you in advance.