Memory model in new Animator classes

Akmanalp, Mehmet A makmanalp at wpi.edu
Tue Oct 20 21:12:57 CEST 2009


On Mon, Oct 19, 2009 at 9:21 AM, Adenilson Cavalcanti <savagobr at yahoo.com>wrote:
>
> The only problem is that internally it will create all the animation
> objects and later destroy them *every* single time that the animation runs.
> This design saves memory (or not, read more about it below) but probably is
> expensive in processing time.
>

If you think about the use cases, I don't think we'll ever see thousands or
even hundreds of animations running at the same time. I don't think the
memory savings is significant at all in this situation anyway, so less
processing time might be nice to aim for, especially in stuff like hover
menus where multiple things are animating at the same time and we want it to
look very smooth. Maybe you can store the QPropertyAnimation inside the
Animation object for later reuse? But if you do that, what happens if I want
to apply the same animation with the same parameters to several objects?
Maybe store several QPropertyAnimations internally? It starts getting a bit
messy.


> If we were able to maintain the animation object 'alive', it could be done
> using only 1 animation object (i.e. grow) and rewinding the animation back
> when the mouse is moved out of the selected icon.
>

I'm not sure if you can "rewind" per se, but as Morpheuz says, you can use
states for the initial and the final situation of the object and add a
transition animation and then switch back and forth between those states.
But then you need to create states each time and keep track of them.

Cheers,

-- 
~ mali (http://constant.inople.net/)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20091020/f930755f/attachment.htm 


More information about the Plasma-devel mailing list