Hello

i have an Problem (maybe its an understanding problem)

i want make an animation with some items. At program Start all Items where init, but only the first 3 should be visible.
After i press a key, the next 3 items should be visible and go to an position.

i have a class which have private QParallelAnimation and a function, where i create new Animation.
in my Constructor of Controller i created the QParallelAnimationGroup and connected it with a slot of Controller-class:

Qt Code:
  1. ...
  2. _groupH = new QParallelAnimationGroup();
  3. connect(_groupH, SIGNAL(finished()), this, SLOT(loeschenAnimationenH()));
  4. ...
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. void Controller::erstelleAnimation(BasisAnzeigeElement* anz, const QPointF& endPos, QParallelAnimationgroup* group)
  2. {
  3. QPropertyAnimation* anim = new QPropertyAnimation(anz, "pos");
  4. anim->setStartValue(anz->pos());
  5. anim->setEndValue(endPos);
  6. group->addAnimation(anim);
  7. }
To copy to clipboard, switch view to plain text mode 


and in the slot loescheAnimationenH() i clear the _groupH, because when i press a key, i emit a signal to the Controller and want to Display the next 3 Items.

Qt Code:
  1. loescheAnimationenH()
  2. {
  3. if(_groupH != NULL)
  4. {
  5. _groupH->clear();
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 

now my Problem is, when i make "anim = new QPropertyAnimation(anz, "pos")" i allways allocate memory, but i never give it free. Does _groupH->clear() deletes all animations and free the memory??

and when yes, how can i fix it?
i thougth to create a List "QList<QPropertyAnimation*> _animList;" and append allways the animation to it and in loescheAnimationH() i check if the _animList is empty, and when not, then i delete _animListe.at(i); and then make a _animListe.clear();

or does i have an understanding problem?

i hope somebodey understands me

with best regards

nudels