Results 1 to 3 of 3

Thread: QTreeView Performance with expandAll and filtering model

  1. #1
    Join Date
    Aug 2010
    Posts
    4
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QTreeView Performance with expandAll and filtering model

    Taking the itemviews/editabletreemodel/* example code and using a larger default.txt file to add way more data and then adding view->setUniformRowHeights(true); and view->expandAll(); leads to a huge delay in showing the initial window. Adding a filter model just kills it. With another test of 300,000 items the filter needed a couple hours to come back. I tried turning QList's into QVector's just to see if that helped.

    How do you get QTreeView to display in a responsive manner thousands of simple text data items that are filtered and expanded so the filtering shows?

    Thanks in advance.

    Here is a Python script to create the default.txt resource file used by the editabletreemodel example:
    -------------------------------------------------
    f = open('./default.txt', 'w')
    for n in range(1, 60000):
    t = ""
    for m in range(1, 5):
    # make-up a name with a random large number ###### and a second column #,#
    s = t + "abcdefg" + str(n*m) + "\t"+str(n) +","+str(m)+"\n"
    t = t + " "
    f.write(s)
    f.close()
    print "Now run make and restart editabletreemodel"
    -------------------------------------------------

  2. #2
    Join Date
    Aug 2010
    Posts
    4
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView Performance with expandAll and filtering model

    Switching between 4.6.3 and 4.7.0 made a huge difference in the expandAll(). Now looking into the filtering issue. The first time is Qt 4.6.3 and the second timing is Qt 4.7.0:

    -------------------------------------
    Finish. Time elapsed: 38532ms
    -------------------------------------
    -------------------------------------
    Finish. Time elapsed: 343ms
    -------------------------------------

  3. #3
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Windows Android

    Default Re: QTreeView Performance with expandAll and filtering model

    I have just found great page about QTreeView performance. Although not directly related to expanding and filtering but 'uniformRowHeights' property has huge performance improvement!

Similar Threads

  1. QTreeView performance slowdown...
    By jpujolf in forum Qt Programming
    Replies: 10
    Last Post: 6th December 2008, 09:15
  2. QDirModel/QTreeView performance under win32
    By roxton in forum Qt Programming
    Replies: 2
    Last Post: 27th July 2008, 18:26
  3. Quick question about filtering item model
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2007, 16:29
  4. QTreeWidget and expandall() function
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2007, 22:49
  5. how to use QTreeView with Database model
    By mikro in forum Newbie
    Replies: 3
    Last Post: 13th April 2006, 16:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.