I am developing a viewer application with model view approach that will display 12 columns of data from a MySQL database. The datasets are to be displayed into a new tab on QTabWidget when selected for the events of that day. The datasets can be very large. I am currently testing with a dataset size of about 56,000 records. I will need 4 of these column need to be able to be set as sortable ASC/DESC.
For handling the large datasets I am using QContiguousCache which gives me get smooth viewing in the tableView. without QContiguousCache the large dataset will lock up the application.
Current design that is generally working
main window creating a new QTableView *m_view
Subclassing QAbstractTableModel into my custom myModel then
m_view->setModel( myModel )
ui->tabEvents->addTab( m_view, tabDate )
my problem now is that I need to sort my dataset. The sorting need to happen before the QContiguousCache class does its magic. in order to do that, I create a backing store from MySQL in ASC and another in DESC. then use QContiguousCache with QFile from the backing store csv file.
Well this works initially until i begin to scroll or page down. at which point thing begin to slow the further in the file the slower things get. With QFile you read line by line so obviously the further in the file you get the longer things will take. I am thinking about trying the seek in the backing store before starting the read. but not sure how I could manage that if I drag my slider 3/4 of the way up or down the view range.
looking for some ideas to get me around this hurdle. any ideas out there?
Thank you,