[Qt-interest] QSqlite Table not showing all rows in app

William Lugg wlugg at prairienetworks.com
Tue Feb 9 02:39:48 CET 2010


That was the ticket.  I had looked at the help for QSqlTableModel and 
completely overlooked the fetchMore and canFetchMore methods.  for my 
situation, I believe a while loop in the constructor to retrieve the rest of 
the records will solve the problem.  I suspected it was something like this 
but couldn't find the key to unlock the problem.

Thanks for the help.
----
Bill Lugg
  Milstar Software Support
  Peterson AFB, CO
  No Micro$oft products were used to create this email.  
  God rules and if He needed a computer it would run Linux!

On Monday 08 February 2010 05:10:29 pm Scott Aron Bloom wrote:
> I haev found that the rowCount() does NOT contain all the rows as long
> as the canFetchMore returns true.  The model only loads 250 rows or so
> into memory at a time.
>
> One way to find all the rows...
>
> QSqlQuery query = model->query();
>
> query.last();
> int numRows = query.at();
>
> Scott
>
> On Feb 8, 2010, at 3:54 PM, William Lugg wrote:
> > I'm sure this would work, but it seems to defeat the whole MVC
> > design pattern offered by Qt. It also doesn't solve the problem of
> > the QDataWidgetMapper and/or the model running out of records
> > prematurely at 250 records.
> >
> > Any ideas as to why the QSqlTableModel is under reporting the size
> > of the table would be greatly appreciated.
> >
> > Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100208/935d17c3/attachment.html 


More information about the Qt-interest-old mailing list