PDA

View Full Version : How to handle huge data with QSqlQueryModel?



alizadeh91
7th December 2013, 12:39
We have a QSqlQueryModel which loads a huge chunk of data. When its size of loaded data reaches to about 1.5 GB, the program crashes. How can we handle this situation? Can we catch an exception or limit the amount of data that QSqlQueryModel loads?

skunkos
7th December 2013, 15:31
Qsqlquerymodel should load 256 items by default, more items can be fetched via fetchMore() method.

http://qt-project.org/doc/qt-4.8/qsqlquerymodel.html#fetchMore