QStyleAnimation: use QAbstractAnimation::DeleteWhenStopped

This ensures that unexpectedly stopped (for example, when minimizing
a window) style animations are removed from QCommonStyle.

Task-number: QTBUG-28978
Change-Id: I1403502d85e0614d8644892a2231938c29a8c9c2
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
J-P Nurmi 2013-01-10 11:28:49 +01:00 committed by The Qt Project
parent cded50e6f2
commit 4d2eb3dd01
2 changed files with 1 additions and 2 deletions

View File

@ -1149,7 +1149,7 @@ void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const
stopAnimation(animation->target());
q->connect(animation, SIGNAL(destroyed()), SLOT(_q_removeAnimation()), Qt::UniqueConnection);
animations.insert(animation->target(), animation);
animation->start();
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
/*! \internal */

View File

@ -53,7 +53,6 @@ QStyleAnimation::QStyleAnimation(QObject *target) : QAbstractAnimation(),
moveToThread(target->thread());
setParent(target);
}
connect(this, SIGNAL(finished()), SLOT(deleteLater()));
}
QStyleAnimation::~QStyleAnimation()