# HG changeset patch # User sheepluva # Date 1351452908 -3600 # Node ID a90936219ffad888bff85a5624c70e7ae8aa7f26 # Parent 2566fc2621d43bbdc8aa04f6e0185a1c0502bc12 let animation objects delete themselves after they are not being used anymore PS: I don't like that we create new animation objects every single time before a page transition is done, I'm sure that can be done in a nicer way. But at least we're not keeping those non-reused objects around forever now... diff -r 2566fc2621d4 -r a90936219ffa QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Sun Oct 28 12:36:08 2012 -0400 +++ b/QTfrontend/hwform.cpp Sun Oct 28 20:35:08 2012 +0100 @@ -693,16 +693,12 @@ animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo); #endif - QParallelAnimationGroup *group = new QParallelAnimationGroup; - group->addAnimation(animationOldSlide); - group->addAnimation(animationNewSlide); -#ifdef false - group->addAnimation(animationOldOpacity); - group->addAnimation(animationNewOpacity); -#endif + // let's hide the old slide after its animation has finished + connect(animationOldSlide, SIGNAL(finished()), ui.Pages->widget(lastid), SLOT(hide())); - connect(animationOldSlide, SIGNAL(finished()), ui.Pages->widget(lastid), SLOT(hide())); - group->start(); + // start animations + animationOldSlide->start(QAbstractAnimation::DeleteWhenStopped); + animationNewSlide->start(QAbstractAnimation::DeleteWhenStopped); /* this is for the situation when the animation below is interrupted by a new animation. For some reason, finished is not being fired */ for(int i=0;iwidget(i)->hide(); @@ -807,16 +803,12 @@ animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo); #endif - QParallelAnimationGroup *group = new QParallelAnimationGroup; - group->addAnimation(animationOldSlide); - group->addAnimation(animationNewSlide); -#ifdef false - group->addAnimation(animationOldOpacity); - group->addAnimation(animationNewOpacity); -#endif + // let's hide the old slide after its animation has finished + connect(animationNewSlide, SIGNAL(finished()), ui.Pages->widget(curid), SLOT(hide())); - connect(animationNewSlide, SIGNAL(finished()), ui.Pages->widget(curid), SLOT(hide())); - group->start(); + // start animations + animationOldSlide->start(QAbstractAnimation::DeleteWhenStopped); + animationNewSlide->start(QAbstractAnimation::DeleteWhenStopped); } #endif diff -r 2566fc2621d4 -r a90936219ffa share/hedgewars/Data/Locale/hedgewars_de.ts --- a/share/hedgewars/Data/Locale/hedgewars_de.ts Sun Oct 28 12:36:08 2012 -0400 +++ b/share/hedgewars/Data/Locale/hedgewars_de.ts Sun Oct 28 20:35:08 2012 +0100 @@ -1171,7 +1171,7 @@ Practice your skills in a range of training missions - Verbessere deine Fähigkeiten in verschidenen Trainingsmissionen + Verbessere deine Fähigkeiten in verschiedenen Trainingsmissionen Demos