diff --git a/animations/expand.cpp b/animations/expand.cpp index e4c6742bc..3468e0b76 100644 --- a/animations/expand.cpp +++ b/animations/expand.cpp @@ -66,8 +66,8 @@ QAbstractAnimation* ExpandAnimation::render(QObject* parent) //Recreate only if needed QPropertyAnimation *anim = dynamic_cast(animation()); if (!anim) { - anim = new QPropertyAnimation(m_object, "geometry", parent); - setAnimation(anim); + anim = new QPropertyAnimation(m_object, "geometry", parent); + setAnimation(anim); } anim->setEndValue(geometry); anim->setDuration(duration()); diff --git a/animations/grow.cpp b/animations/grow.cpp index 9464ba813..c7c70cec0 100644 --- a/animations/grow.cpp +++ b/animations/grow.cpp @@ -62,8 +62,8 @@ QAbstractAnimation* GrowAnimation::render(QObject* parent){ //Recreate only if needed QPropertyAnimation *anim = dynamic_cast(animation()); if (!anim) { - anim = new QPropertyAnimation(m_object, "geometry", parent); - setAnimation(anim); + anim = new QPropertyAnimation(m_object, "geometry", parent); + setAnimation(anim); } anim->setEndValue(QRectF( diff --git a/animations/pause.cpp b/animations/pause.cpp index 2efbd3f83..f7ed5c1f2 100644 --- a/animations/pause.cpp +++ b/animations/pause.cpp @@ -34,8 +34,8 @@ QAbstractAnimation* PauseAnimation::render(QObject* parent) //Recreate only if needed QPauseAnimation *anim = dynamic_cast(animation()); if (!anim) { - anim = new QPauseAnimation(duration(), parent); - setAnimation(anim); + anim = new QPauseAnimation(duration(), parent); + setAnimation(anim); } return anim; diff --git a/animations/pulser.cpp b/animations/pulser.cpp index ca0be15f1..a82e78aad 100644 --- a/animations/pulser.cpp +++ b/animations/pulser.cpp @@ -114,32 +114,32 @@ void PulseAnimation::createAnimation(qreal duration, qreal scale) QParallelAnimationGroup *anim = dynamic_cast(animation()); if (!anim) { - d->pulseGeometry = new QRectF(d->under->geometry()); - QParallelAnimationGroup *group = new QParallelAnimationGroup(this); - d->opacityAnimation = new QPropertyAnimation(d->under, "opacity"); - d->opacityAnimation->setDuration(duration); - d->opacityAnimation->setEndValue(0); - group->addAnimation(d->opacityAnimation); + d->pulseGeometry = new QRectF(d->under->geometry()); + QParallelAnimationGroup *group = new QParallelAnimationGroup(this); + d->opacityAnimation = new QPropertyAnimation(d->under, "opacity"); + d->opacityAnimation->setDuration(duration); + d->opacityAnimation->setEndValue(0); + group->addAnimation(d->opacityAnimation); - /* TODO: move this to a function */ - d->geometryAnimation = new QPropertyAnimation(d->under, "geometry"); - d->geometryAnimation->setDuration(duration); - QRectF initial(d->under->geometry()); - qreal W = initial.width() * scale * 0.33; - qreal H = initial.height() * scale * 0.33; - QRectF end(initial.x() - W, initial.y() - H, initial.width() * scale, - initial.height() * scale); - d->geometryAnimation->setEndValue(end); - group->addAnimation(d->geometryAnimation); + /* TODO: move this to a function */ + d->geometryAnimation = new QPropertyAnimation(d->under, "geometry"); + d->geometryAnimation->setDuration(duration); + QRectF initial(d->under->geometry()); + qreal W = initial.width() * scale * 0.33; + qreal H = initial.height() * scale * 0.33; + QRectF end(initial.x() - W, initial.y() - H, initial.width() * scale, + initial.height() * scale); + d->geometryAnimation->setEndValue(end); + group->addAnimation(d->geometryAnimation); - d->scaleAnimation = new QPropertyAnimation(d->under, "scale"); - d->scaleAnimation->setDuration(duration); - d->scaleAnimation->setEndValue(scale); - /* The group takes ownership of all animations */ - group->addAnimation(d->scaleAnimation); - d->animation = group; - setAnimation(d->animation); - dirty = true; + d->scaleAnimation = new QPropertyAnimation(d->under, "scale"); + d->scaleAnimation->setDuration(duration); + d->scaleAnimation->setEndValue(scale); + /* The group takes ownership of all animations */ + group->addAnimation(d->scaleAnimation); + d->animation = group; + setAnimation(d->animation); + dirty = true; } else { @@ -166,9 +166,9 @@ void PulseAnimation::createAnimation(qreal duration, qreal scale) } if (dirty) { - //This makes sure that if there is *not* a shadow widget, the - //parent widget will still remain visible - connect(d->animation, SIGNAL(finished()), this, SLOT(resetPulser())); + //This makes sure that if there is *not* a shadow widget, the + //parent widget will still remain visible + connect(d->animation, SIGNAL(finished()), this, SLOT(resetPulser())); } } diff --git a/animations/rotation.cpp b/animations/rotation.cpp index 7a3c121c2..6bc007985 100644 --- a/animations/rotation.cpp +++ b/animations/rotation.cpp @@ -145,8 +145,8 @@ QPropertyAnimation *RotationAnimation::render(QObject *parent) QPropertyAnimation *rotationAnimation = dynamic_cast(animation()); if (!rotationAnimation) { - rotationAnimation = new QPropertyAnimation(d->rotation, "angle", m_object); - setAnimation(rotationAnimation); + rotationAnimation = new QPropertyAnimation(d->rotation, "angle", m_object); + setAnimation(rotationAnimation); } rotationAnimation->setStartValue(0); diff --git a/animations/rotationstacked.cpp b/animations/rotationstacked.cpp index ce782ed3b..d29fdcbb9 100644 --- a/animations/rotationstacked.cpp +++ b/animations/rotationstacked.cpp @@ -98,19 +98,19 @@ QAbstractAnimation *RotationStackedAnimation::render(QObject *parent) QSequentialAnimationGroup *groupAnim = dynamic_cast(animation()); if (!groupAnim) { - groupAnim = new QSequentialAnimationGroup(parent); - frontAnim = new QPropertyAnimation(d->frontRotation, "angle", groupAnim); - backAnim = new QPropertyAnimation(d->backRotation, "angle", groupAnim); - setAnimation(groupAnim); - dirty = true; + groupAnim = new QSequentialAnimationGroup(parent); + frontAnim = new QPropertyAnimation(d->frontRotation, "angle", groupAnim); + backAnim = new QPropertyAnimation(d->backRotation, "angle", groupAnim); + setAnimation(groupAnim); + dirty = true; } else { - if (groupAnim->animationCount() == 2) { - frontAnim = dynamic_cast(groupAnim->animationAt(0)); - backAnim = dynamic_cast(groupAnim->animationAt(1)); - } else { - kDebug() << "_ Where are my little animations? Duh!"; - return groupAnim; - } + if (groupAnim->animationCount() == 2) { + frontAnim = dynamic_cast(groupAnim->animationAt(0)); + backAnim = dynamic_cast(groupAnim->animationAt(1)); + } else { + kDebug() << "_ Where are my little animations? Duh!"; + return groupAnim; + } } const qreal widgetFrontWidth = widgets.first->size().width(); @@ -155,9 +155,9 @@ QAbstractAnimation *RotationStackedAnimation::render(QObject *parent) backAnim->setDuration(duration()/2); if (dirty) { - connect(frontAnim, SIGNAL(finished()), this, SLOT(rotateBackWidget())); - groupAnim->addAnimation(frontAnim); - groupAnim->addAnimation(backAnim); + connect(frontAnim, SIGNAL(finished()), this, SLOT(rotateBackWidget())); + groupAnim->addAnimation(frontAnim); + groupAnim->addAnimation(backAnim); } return groupAnim; diff --git a/animations/slide.cpp b/animations/slide.cpp index ea87e4a5b..ef08d1526 100644 --- a/animations/slide.cpp +++ b/animations/slide.cpp @@ -42,21 +42,22 @@ QAbstractAnimation* SlideAnimation::render(QObject* parent) qreal newX = x; qreal newY = y; + kDebug()<