Results 1 to 3 of 3

Thread: Does QSqlTableModel have limited capacity?

  1. #1
    Join Date
    Jul 2009
    Posts
    39
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Does QSqlTableModel have limited capacity?

    Qt Code:
    1. model.setTable("tableName");
    2. model.select();
    3. int x=model.rowCount();
    To copy to clipboard, switch view to plain text mode 

    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?

  2. #2
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does QSqlTableModel have limited capacity?

    See here:
    http://qt.nokia.com/doc/4.5/qsqlquer....html#rowCount

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

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does QSqlTableModel have limited capacity?

    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.

Similar Threads

  1. Replies: 4
    Last Post: 9th May 2008, 17:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.