Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Animation framework



  • 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 ?

    Thanks


  • Lifetime Qt Champion

    Hi,

    There's no leak, the "QAnimationGroup":http://qt-project.org/doc/qt-5.0/qtcore/qanimationgroup.html#details takes ownership of the QPropertyAnimation you add to it.


Log in to reply