How can I dynamically filter rows in a QTableView while also using 'lazy loading'?

时间:2016-02-12 20:54:54

标签: qt pyqt qt4 qtableview

I have a small test script shown below, written in Python to demonstrate my point. In summary, I have a skills implementation which defines QAbstractTableModel and canFetchMore in order limit the number of rows that the fetchMore loads at once.

This code works great, however I also have QTableView function which I've defined that filters the setView. My problem is, whenever I hide rows from the QTableView, it does not trigger the QTableView method in my model - so what ends up happening is I get a very blank looking table until I scroll it, triggering the fetchMore method.

What can I do to ensure that both the 'lazy loading' AND filtering capabilities of this program work properly? My end-use case is on a much larger data set, so having both functionalities is very important.

fetchMore

0 个答案:

没有答案