I use QTableView to show data contained in my LogsModel (which inherits QAbstractTableModel). In order to enable sorting and filtering I use QSortFilterProxyModel as a proxy between LogsModel and QTableView. LogsModel is refreshed from time to time (it takes additional items from the database)

Now the problem is that my model can contain multi-line text strings. In that case I have the following problem with displaying these messages: I can see only the bottom of the first line and the top of the second line (in case of 2-lined message)

This issue can be easily solved if I invoke method resizeRowToContents(int i) of QTableView class. But the problem is that table is refreshed from time to time (when changing sorting order, or when filter is applied, or some new items appear in LogsModel). So every time it refreshes I should resize all the rows in the table (because I don't know exact place where new rows have appeared). But this is very time-consuming because table may contain thousands rows.

So, the question is: how to make multi-line message fully visible in QTableView taking into account all that I said before.

Probably I can resize only currently visible rows. In this respect my question is: how can I get to know which rows of the QTableView are currently visible?