PDA

View Full Version : Does QSqlTableModel have limited capacity?



metdos
13th December 2009, 11:09
QSqlTableModel model;
model.setTable("tableName");
model.select();
int x=model.rowCount();

I'm getting x=256 all the times no matter how many rows are there in table.

Is there any way to increase or remove this limit?

waynew
1st January 2010, 22:00
See here:
http://qt.nokia.com/doc/4.5/qsqlquerymodel.html#rowCount

If you want the number of rows, you can always SELECT count(*)

squidge
1st January 2010, 22:06
As far as I'm aware, using rowCount is unreliable, as it may just be the amount of rows currently displayed, rather than the amount of rows actually fetched (canFetchMore == true). So, depending on what your trying to achieve, maybe something like waynew suggests would be better.