Results 1 to 4 of 4

Thread: Using tableview with CSV

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    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: Using tableview with CSV

    The column count is known once you read the first record of the CSV file.
    You can read the entire CSV file to determine a total row count. For a small file this is probably easiest.

    Alternatively, implement a lazy fetching mechanism where you read rows in sets of up to n rows and return rowCount() of the number actually read to date. On open/reset the model reads up to n rows and rowCount() returns the number read. Implement canFetchMore() and fetchMore() to allow views to see the entire table if required. QSqlTableModel uses this approach with n == 256.

  2. The following user says thank you to ChrisW67 for this useful post:

    akshaysulakhe (19th July 2013)

Similar Threads

  1. tableview with doubles
    By Arend in forum Newbie
    Replies: 2
    Last Post: 26th November 2012, 06:43
  2. tableview
    By GuL in forum Newbie
    Replies: 1
    Last Post: 26th August 2008, 17:18
  3. help in tableview
    By bala in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2007, 15:46
  4. getting data from tableView
    By mkarakaplan in forum Newbie
    Replies: 1
    Last Post: 7th November 2007, 09:51
  5. getting current Id from tableView
    By mkarakaplan in forum Newbie
    Replies: 3
    Last Post: 7th October 2007, 22:14

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.