The application I'm working on uses a QTableView to display data from the database. The problem that I'm having is that when the application loads, the table calls the data() method for every cell, even cells that aren't visible. Since I'm displaying thousands of rows of data, this causes quite a lag on startup.

To solve this problem I'm considering some way to "page" through the data. By that I mean that I only want to make the data() call to the backend when the row actually becomes visible. My initial idea is to determine the correct row and column counts and then build a table full of empty cells. Somehow I'd like to create an "rowIsVisible" signal that table can emit when new rows become visible and that would trigger the call to the backend. Has anyone tried anything similar to this? Any ideas/thoughts/experiences on the subject are greatly appreciated.

Thanks,

Jimmy