ListView is (very) slow to move to current item
-
[quote author="Alexander Kuchumov" date="1292868441"]Andre, where is it in QListView? QListView also evaluates height for all elements.[/quote]
It is right "here":http://doc.qt.nokia.com/4.6/qlistview.html#uniformItemSizes-prop. You can tell QListView that the items are all the same size, and then it only evaluates the hight of the first item. -
Andre, I've missed this function:)
-
Don't :-) It can make a huge difference in QListViews performance.
-
positionViewAtIndex() does not calculate the height of intermediary items. That is the point of that function.
-
MartinJ is right, positionViewAtIndex uses averageSize .
-
How is averageSize calculated? It is not a property of the ListView element, so where does it come from?
-
Andre, averageSize is calculated for last visible elements.
-
OK, that makes sense I guess.
-
Hi, I have a problem similar to yours. I have a ListView with possibly thousands of elements. I keep a property in my PySide backend which is the currentIndex for my ListView. Whenever I change the index, the ListView should scroll to the current item.
It works, but the scrolling is very slow. I think it is the same problem you are describing. Do you have any idea how should I solve my case?
-
Anybody has a suggestion? I have the same problem on my arm 300 mhz device... I also want to drop the scroll animation and just jump immediately to the next item.