Results 1 to 3 of 3

Thread: True virtual model-view ?

  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default True virtual model-view ?

    I was waiting for 4.6 to offer something new in the area of model-view architecture and did not find any changes, at least in the documentation. Hope that I missed smth!

    I have a view of over 10^6 entries in the file that I am showing in a treeview (3 columns).

    I had to implement my own paging because Qt model shows all top-level items on the start, which makes showing that # of items using default Qt mechanics impossible.

    Can anybody suggest a better Qt-based way of showing that many entries? Oh, how I miss virtual lists in C#...

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

    Default Re: True virtual model-view ?

    I'm using a QTreeView in a project at the moment that can contain upwards of 1 million items, and Qt only requests the items that are visible, not all of them, so the view is instant.

    Maybe you can post some code?

  3. #3
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: True virtual model-view ?

    Quote Originally Posted by TorAn View Post
    I had to implement my own paging because Qt model shows all top-level items on the start, which makes showing that # of items using default Qt mechanics impossible.

    Can anybody suggest a better Qt-based way of showing that many entries? Oh, how I miss virtual lists in C#...
    You have to call
    Qt Code:
    1. setUniformRowHeights ( true )
    To copy to clipboard, switch view to plain text mode 

    This avoids calling ALL row heights on startup and as fatjuicymole said, will only call for visible data. The speedup is noticeable...

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 21:17
  2. Model Or View problem
    By Nefastious in forum Newbie
    Replies: 2
    Last Post: 9th October 2009, 20:44
  3. Model / View - Design Question
    By antarctic in forum Qt Programming
    Replies: 8
    Last Post: 8th June 2009, 08:39
  4. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 18:50
  5. Replies: 6
    Last Post: 20th April 2006, 11:23

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.