PDA

View Full Version : Strange behaviour when adding serveral thousend items to QTreeWidget



lunatic fringe
25th February 2010, 20:22
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.

franz
25th February 2010, 23:01
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 (http://doc.trolltech.com/latest/model-view-programming.html).