PDA

View Full Version : Speed up QTreeView animation



MorrisLiang
18th June 2010, 05:50
http://i960.photobucket.com/albums/ae82/liangmorr/1.jpg http://i960.photobucket.com/albums/ae82/liangmorr/3.jpg

Here are 2 pics from my app.I have a QTreeView in my app.When user press a button,another widget comes in and the treeview will slide from the center to the right(just like the 2nd pic.).

The problem is the animation is kinda slow(when I have as much items as the picture shows).
If I have only a few items in my treeview(4 or 5...),the animation is smooth.
I guess it's because treeview is updating all the items when it animates.But I don't know how to make it faster.Anybody knows?

aamer4yu
18th June 2010, 08:20
You can disable animations with QTreeView::setAnimated

MorrisLiang
18th June 2010, 13:49
I'm not talking about the animation of expanding the treeview.
I was trying to move the QTreeView from one position to another,by using QPropertyAnimation.But when there's a lot items in the treeview,the animation is slow.

aamer4yu
18th June 2010, 15:43
You can use a trick then -
To start animation, hide the treeview and render the treeview onto a pixmap.
Now perform animation on this pixmap.
Finally when the animation ends, hide the pixmap and show the treeview again...
This should speed up things :-)