Results 1 to 4 of 4

Thread: Tip for DB querying and table output?

  1. #1
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Tip for DB querying and table output?

    I have database which I would require to query it and output as table.
    The thing is fairly simple as I would use table models etc.

    The problem is when I encounter huge amount of rows(speaking of 5000+ rows of data);
    Can anyone recommend me a way?

    I've done something similar in php/jquery, but there I was able to paginate the results which is a simple process while in qt I couldn't find a succesful example/tutorial.

    I am not expecting someone to write me the code and post it here, just tell me where to look or what is a preffered way to do it.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Tip for DB querying and table output?

    QTableModel and QTableView. QTableView does lazy retrieval of rows (256 at a time).

  3. #3
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Tip for DB querying and table output?

    Your link to QTableModel is broken, do you refer to QSqlTableModel?
    I am looking to make a Table that will return a specific number(let's limit it to 15), and let the user toggle between first 15 rows,next 15 rows,previous 15 etc.

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tip for DB querying and table output?

    Simple use QSqlTableModel and set limits in SQL query. After user action change query.

  5. The following user says thank you to Lesiok for this useful post:

    adutzu89 (28th January 2014)

Similar Threads

  1. Output Table
    By ToddAtWSU in forum Qt Programming
    Replies: 6
    Last Post: 9th April 2013, 20:55
  2. Querying signal/slot state at runtime
    By lxman in forum Qt Programming
    Replies: 11
    Last Post: 8th March 2011, 07:49
  3. Querying a database and populating a combobox
    By Splatify in forum Newbie
    Replies: 7
    Last Post: 21st February 2011, 11:28
  4. Querying object type using itemAt
    By ajb in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2009, 16:35
  5. Querying within Threads
    By bera82 in forum Qt Programming
    Replies: 11
    Last Post: 12th March 2008, 01:08

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.