Results 1 to 2 of 2

Thread: Handling mass data with QTreeView/QTableView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Handling mass data with QTreeView/QTableView

    Hallo all,

    I am just wondering how to handle big amounts of data with the above mentioned views. I am using Qt 4.1.4. My problem here is:

    I have a big amount of data (e.g. 100000 items) stored in an MySQL database that can only be retrieved via a special interface (usage of QtSQL classes therefore not possible here).
    Retrieving these items is not very fast and so I thought it would be a good idea to implement a kind of cache that handles 50 items (which is the maximum amount of data that can be shown in the view) and reload other items by the underlying model within the index() method into the cache when the appropriate index is called (e.g if index 51 is called, the first item in my cache is thrown away since it is no more visible in the view and the item 51 is loaded from the database). The models rowCount() method is set to 100000 in this example.

    This approach seemed to work so far for a QTableView. My problem now is when I am trying a similar approach with a QTreeView I am running into problems since QTreeView seems to call the models index() method for all items from 0 to rowCount() even if these are not visible.

    So I am wondering if my approach is wrong or if there is something I can do to hinder QTreeView from calling index() for all items even if these are not visible.

    Thanks for any hint
    Greetings
    Kai

    PS: CUrrently playing with QT4.2 rc1. Seems that the QTableView of this version now behaves as the QTreeView in my above example. My problem now becomes more urgent because it seems that my approach is wrong.
    Last edited by alsuffndruff; 1st October 2006 at 23:44.

Similar Threads

  1. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53
  2. How to convert binary data to hexadecimal data
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 8th March 2006, 16:17
  3. Replies: 16
    Last Post: 7th March 2006, 15:57

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.