I've got a QTableView setup. It is having rows filtered out by a subclassed QSortFilterProxyModel, and it is being painted by a subclassed QItemDelegate. The table continually has items added to it. Imagine ping replies, where each line would represent a row. Everything works, except that when I add a row, paint() is called for each cell... including those not shown in the viewport. If I have 1999 rows and 5 columns, when I insert the next item, paint() will be called 10,000 times (even though about 10 rows are showing).
I thought the essence of the model/view paradigm was that it only paints what is visible to the user. Am I doing something wrong?
EDIT: Okay, the problem is b/c instead of using the Proxy for all removal of rows (not just not-allowing some in) I was manually setting the rowHeight to 0 in the view.
Hmm... not sure how to do this. Some rows need to be removed intermittently. I found that calling invalidate() is useless b/c it will then call filterAcceptsRow() on all rows -- visible or not. reset() was not any better.
Guess I need to approach this differently. Or I'm missing something fundamental about the filter, and invalidating it.
EDIT2: I guess the answer would be calling invalidate() only if the line that needs to be removed is visible. Hmm....
This post has been edited 2 times, last edit by "kiss-o-matic" (May 31st 2012, 7:36am) with the following reason: Found something