PDA

View Full Version : Performance issue



Skorpien126
23rd June 2010, 16:26
Hello,
I´m currently facing a performance problem with QTreeWidgets. Lets says I have about 3000 elements in a hierachial tree and furthermore two rows. The first row is for the standard selection and the second contains some checkboxes which can also be checked. For both I implemented the exactly same "intelligent" algorithm of marking further subelements etc.

When use the standard selection to mark the root element it takes about 2 sec. to mark (select) all subelements - but if I use the root checkbox it takes only 0.1 sec to mark (set checkboxvalue same as root) all subelemts. I quess that setting the background color of an element is responsible for this slow down - any ideas how I can speed it up???? I tried it with the setUpdatesEnabled() function but that didn´t helped.

best regards - Skorpien126

Skorpien126
24th June 2010, 12:37
Hi All...
I´ve build an simple sample to show my problem. It´s not very nice but it show my problem. Has anyone an idea what could be wrong.
Thanks in advance . Stefan

See the attachment for the example.

squidge
24th June 2010, 12:53
Have you tried using a QTreeModel rather than QTreeWidgets? Seperating the data and views could give you a performance increase.

Skorpien126
28th June 2010, 07:55
Sorry for answering so lately - but yes - I´ve also tried this. Unfortunately this didn´t helped. :(

Can someone please take a look at the example - I need a further opinion!

Skorpien126
2nd July 2010, 16:02
After creating subclasses of QTreeWidget/QTreeWidgetItem and implementing my own setSelected function I got an enourmous speed up - but nevertheless it would have been interesting to know why the org. implementation is so "slow".