From: J-P Nurmi Date: Tue, 23 Oct 2012 08:53:40 +0000 (+0200) Subject: QStyleAnimation: fix threaded rendering X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7abf6234436aee377d15f9f2f1d37ee7daf7464e;p=profile%2Fivi%2Fqtbase.git QStyleAnimation: fix threaded rendering Change-Id: I00875adf2e4b157a3f8b0b99e5280b1275635026 Reviewed-by: Jens Bache-Wiig --- diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 0e22a90..990245a 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1073,7 +1073,6 @@ void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const { Q_Q(const QCommonStyle); stopAnimation(animation->target()); - q->connect(animation, SIGNAL(finished()), SLOT(_q_removeAnimation()), Qt::UniqueConnection); q->connect(animation, SIGNAL(destroyed()), SLOT(_q_removeAnimation()), Qt::UniqueConnection); animations.insert(animation->target(), animation); animation->start(); @@ -1096,10 +1095,8 @@ void QCommonStylePrivate::_q_removeAnimation() { Q_Q(QCommonStyle); QObject *animation = q->sender(); - if (animation) { + if (animation) animations.remove(animation->parent()); - animation->deleteLater(); - } } /*! diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp index 6173dc9..9f58c9d 100644 --- a/src/widgets/styles/qstyleanimation.cpp +++ b/src/widgets/styles/qstyleanimation.cpp @@ -47,9 +47,14 @@ QT_BEGIN_NAMESPACE -QStyleAnimation::QStyleAnimation(QObject *target) : QAbstractAnimation(target), +QStyleAnimation::QStyleAnimation(QObject *target) : QAbstractAnimation(), _startTime(QTime::currentTime()) { + if (target) { + moveToThread(target->thread()); + setParent(target); + } + connect(this, SIGNAL(finished()), SLOT(deleteLater())); } QStyleAnimation::~QStyleAnimation()