X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftransition.cpp;h=c3c36e4d989a00d5739dfe7976f45c77cd65b4ce;hb=b3d157e4bcfa9d9c04f53e6e7636f3c22c9d0625;hp=fe3aa518e7c265bbb993e780ea97f5adebadcdb6;hpb=674229de00f3b42f64251808087651b0ccd1d6c9;p=kdenlive diff --git a/src/transition.cpp b/src/transition.cpp index fe3aa518..c3c36e4d 100644 --- a/src/transition.cpp +++ b/src/transition.cpp @@ -43,14 +43,14 @@ Transition::Transition(const ItemInfo &info, int transitiontrack, double fps, QD setPos(info.startPos.frames(fps), (int)(info.track * KdenliveSettings::trackheight() + itemOffset() + 1)); #if QT_VERSION >= 0x040600 - m_startAnimation = new QPropertyAnimation(this, "rect"); - m_startAnimation->setDuration(200); + QPropertyAnimation *startAnimation = new QPropertyAnimation(this, "rect", this); + startAnimation->setDuration(200); QRectF r(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight() / 2); QRectF r2(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)itemHeight()); - m_startAnimation->setStartValue(r); - m_startAnimation->setEndValue(r2); - m_startAnimation->setEasingCurve(QEasingCurve::OutQuad); - m_startAnimation->start(); + startAnimation->setStartValue(r); + startAnimation->setEndValue(r2); + startAnimation->setEasingCurve(QEasingCurve::OutQuad); + startAnimation->start(QAbstractAnimation::DeleteWhenStopped); #else setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight()); #endif @@ -79,9 +79,6 @@ Transition::Transition(const ItemInfo &info, int transitiontrack, double fps, QD Transition::~Transition() { blockSignals(true); -#if QT_VERSION >= 0x040600 - delete m_startAnimation; -#endif if (scene()) scene()->removeItem(this); }