How to show many records in QTableView
-
Hi,
I'm using QTableView to view a query result includes 500,000 records but unfortunately QTableView became too slow (it spend about 5min to show them)!
How can I load 500,000 records on QTableView as fast as I can get?
Here's a snippet of my code:
[code]_filterProxy = new QSortFilterProxyModel(this);
_filterProxy->setSourceModel(_db->model_analysisInResults());
_filterProxy->setFilterKeyColumn(1);//FIXME: enhance table view for 1/2 million records ui->tableView_analyse->setModel(_filterProxy);[/code]
P.S I imagine two solutions but I don't know how to perform them (or one of them)!
Split the records to pages (similar to google).
Load the viewed records only thus the used memory of the application will be small.
-
After googling for hours I "found a single result":https://stackoverflow.com/a/21162847 which is somehow answering my question but unfortunately it's very theoretically.
May someone help me to find a practical solution (snippet, library... etc)