PDA

View Full Version : animate items



ensky_cy
4th December 2009, 01:06
hello,
there some items,but i want to animate the item, such as zooming the item with a timeline.because there is only item, no Object,I am at a loss what to do.
I want to use QGraphicsItemAnimation ,but how to use it to enlarge one item with timeline.
Thanks!

aamer4yu
4th December 2009, 05:05
Have a look at embedded dialog example in Qt demos.. under Demonstrations..
I guess they also use a timeline..

ensky_cy
4th December 2009, 07:31
thanks.I use QGraphicsItemAnimate.
however.

for (int i = 0; i < 2000; ++i)
{
animation->setScaleAt(i/2000,1+4*(i/2000),1+4*(i/2000));
}
I cann't see the gradual change,although, timer = new QTimeLine(2000);
timer->setFrameRange(0, 300);
"setScaleAt(i/2000,1+4*(i/2000),1+4*(i/2000))",this don't understand.

(sorry,i don't know how to insert code)