[Interest] Animation Framework

Graham Labdon Graham.Labdon at avalonsciences.com
Mon Dec 2 17:28:21 CET 2013


Thanks

-----Original Message-----
From: interest-bounces+graham.labdon=avalonsciences.com at qt-project.org [mailto:interest-bounces+graham.labdon=avalonsciences.com at qt-project.org] On Behalf Of Nurmi J-P
Sent: 02 December 2013 16:19
To: Interest at qt-project.org
Subject: Re: [Interest] Animation Framework

On 02 Dec 2013, at 16:40, Graham Labdon <Graham.Labdon at avalonsciences.com> wrote:

> Hi
> If I have a group of animations and have added them to a group -
>                         QPropertyAnimation *Animation1 = new QPropertyAnimation(widget1, "pos");
>                         QPropertyAnimation *Animation2 = new QPropertyAnimation(widget2, "pos");
>  
>                         QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup;
>                         animationGroup ->addAnimation(Animation1);
>                         animationGroup ->addAnimation(Animation2);
>  
>                         animgroup->start(QAbstractAnimation::DeleteWhenStopped);
>  
> Does this result in a memory leak or will the individual animations be deleted when the animation group completes ?
>  

Hi,

It won't leak, since QAnimationGroup takes ownership of the grouped animations.

http://qt-project.org/doc/qt-5.1/qtcore/qanimationgroup.html#addAnimation

"Note: The group takes ownership of the animation."

--
J-P Nurmi

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list