Results 1 to 2 of 2

Thread: Strange behaviour when adding serveral thousend items to QTreeWidget

  1. #1
    Join Date
    Feb 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Strange behaviour when adding serveral thousend items to QTreeWidget

    Hello,

    my programm adds about 7000 items to a treewidget from a different thread.
    The thread finishes before the items are nearly partially appears in the tree.
    If the thread repeatly pauses for an instance the GUI stays responsive.

    Are there any signals to get informed if items are added or if the adding procedure has completed ?

    Regards
    l.f.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Strange behaviour when adding serveral thousend items to QTreeWidget

    For large amounts of data the QTreeWidget is far from the best option. Create your own class inheriting from QAbstractItemModel that implements the behavior you need and use a QTreeView to view it's contents. It will be much much faster that way. Have a good look at Model/View Programming.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Strange mouseReleaseEvent behaviour.
    By ricardo in forum Newbie
    Replies: 11
    Last Post: 5th May 2009, 23:35
  2. Need help: Strange behaviour
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2008, 04:03
  3. Too slow adding & defining items to QTreeWidget
    By jnk5y in forum Qt Programming
    Replies: 16
    Last Post: 22nd April 2008, 20:26
  4. Strange Painter behaviour
    By cwomeijer in forum Qt Programming
    Replies: 2
    Last Post: 4th September 2006, 20:52
  5. very strange behaviour
    By regix in forum Qt Programming
    Replies: 23
    Last Post: 20th July 2006, 17:38

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.