title: Using large record set with QTableView and QAbstractTableModel -- retrieve visible rows only
body: <p>I'm using PyQt and showing a table of data in a QTableView. I'm simply looking for a way to avoid calling the ENTIRE data set into memory when no more than 100 lines will ever appear on the screen. Theoretically, I should be able to browse a table containing hundreds of thousands of records nearly instantly, if I'm just retrieving the visible data.</p>
  
  <p>So as I understand it, when the QTableView wants to show a cell of data, it calls the "data()" function of my table model (which subclasses QAbstractTableModel). That function receives the row and column index of the cell that's supposed to show. This works great for me if I have already loaded all the data I need.</p>
  
  <p>BUT if I don't have all the data yet, won't I have to make a query for each cell? Is there another way to do this? Perhaps there's a way to grab data row-by-row instead of cell-by-cell. Perhaps there's a database-specific solution for MySql, which is what we're using.</p>