From 4d2eb3dd01620f4e26f97dca747206ddbc0840c7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 10 Jan 2013 11:28:49 +0100 Subject: 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 Reviewed-by: Kai Koehne --- src/widgets/styles/qcommonstyle.cpp | 2 +- src/widgets/styles/qstyleanimation.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 7519d7f910..75407c11c5 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -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 */ diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp index 9ddcbcc511..bed3192219 100644 --- a/src/widgets/styles/qstyleanimation.cpp +++ b/src/widgets/styles/qstyleanimation.cpp @@ -53,7 +53,6 @@ QStyleAnimation::QStyleAnimation(QObject *target) : QAbstractAnimation(), moveToThread(target->thread()); setParent(target); } - connect(this, SIGNAL(finished()), SLOT(deleteLater())); } QStyleAnimation::~QStyleAnimation() -- cgit v1.2.3