Results 1 to 8 of 8

Thread: Need lazy load approach for treeview & wanted to maintain only viewing items in mem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Need lazy load approach for treeview & wanted to maintain only viewing items in

    Thanks, I will look into the link.

    Edited : gone through the link, Looks like they have not fixed the bug instead they suggested to build 64-bit application, my application is 64 bit any how .

    BTW: how did you do memory management in this case, As you have huge row & we need to build tree before population it onto view.
    So did you manage the memory. did you create entire tree (items) and populate it or in some other way ??
    Last edited by prasad_N; 4th July 2015 at 21:59.
    Thanks :-)

  2. #2
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Need lazy load approach for treeview & wanted to maintain only viewing items in

    I have 2 different applications for this. In one application the data are stored in a file, all with equal record size. So if I know a row number, I can compute the location in the file and load the data from there. Of course I do some caching of data to improve performance.

    In the second application a single column of data is stored in memory. From the context of the application I know that there is a limitation of 200 million data points (each a double) and I have to keep those data in memory (simple std::vector) anyway because a bunch of numerical algorithms are applied to the data basically reducing the millions of double values into pass/fail results. So I need up to 1.6GB of ram. Allocating this is no big problem in today PCs with 64 bit OS and 8 or 16GB ram. That's for the first column in my table. There are further columns, but the elements of these columns are computed on the fly from the data in the first column when the data in the other column gets read by a view. Therefore I do not need to allocate memory for these columns.

    As I mentioned before, I store my data in a std::vector object. The model used by my table view does not store data by itself. Instead, it gets a reference to my data vector and accesses the vector for reading the data. That prevents duplicating data just for displaying them in a table. So in my case, the Qt table model serves as a "glue" between my data (std::vector) and the Qt table view objects.

    Best regards
    ars

  3. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Need lazy load approach for treeview & wanted to maintain only viewing items in

    Oops.. Thanks for the detailed answer.
    In my case this may not work because before populating a tree, need to build the tree this is not a case with table or list view. This is the reason I wanted to go with lazy population model and left with the above doubts.
    Thanks :-)

  4. #4
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Need lazy load approach for treeview & wanted to maintain only viewing items in

    Any suggestions from others ???
    Thanks :-)

Similar Threads

  1. How many items can Treeview /Tableview holds ?
    By prasad_N in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2015, 05:32
  2. Nesting TableViews under TreeView items
    By marcuso in forum Qt Programming
    Replies: 9
    Last Post: 24th March 2012, 18:00
  3. Replies: 1
    Last Post: 4th August 2011, 22:36
  4. Replies: 1
    Last Post: 9th August 2009, 19:51
  5. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53

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.