* actually start the timeline (durr!)
* open up the possiblity to change the CurveShape depending on the effect svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=673396
This commit is contained in:
parent
3b8fc737e4
commit
2360b4b210
@ -102,6 +102,7 @@ void Phase::animate(QGraphicsItem* item, Animation animation)
|
||||
}
|
||||
|
||||
int frames = 0;
|
||||
QTimeLine::CurveShape curveShape = QTimeLine::EaseInOutCurve;
|
||||
switch (animation) {
|
||||
case Appear:
|
||||
frames = d->animator->appearFrames();
|
||||
@ -123,6 +124,7 @@ void Phase::animate(QGraphicsItem* item, Animation animation)
|
||||
|
||||
QTimeLine* timeLine = new QTimeLine(333, this);
|
||||
timeLine->setFrameRange(0, frames / 3.0);
|
||||
timeLine->setCurveShape(curveShape);
|
||||
|
||||
AnimationState state;
|
||||
state.item = item;
|
||||
@ -131,6 +133,7 @@ void Phase::animate(QGraphicsItem* item, Animation animation)
|
||||
d->theAnimated[item] = timeLine;
|
||||
connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(advanceFrame(int)));
|
||||
connect(timeLine, SIGNAL(finished()), this, SLOT(animationComplete()));
|
||||
timeLine->start();
|
||||
}
|
||||
|
||||
void Phase::advanceFrame(int frame)
|
||||
@ -138,12 +141,14 @@ void Phase::advanceFrame(int frame)
|
||||
QTimeLine* timeLine = dynamic_cast<QTimeLine*>(sender());
|
||||
|
||||
if (!timeLine) {
|
||||
kDebug() << "Phase::advanceFrame found no timeLine!" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
QMap<QTimeLine*, AnimationState>::iterator it = d->animations.find(timeLine);
|
||||
|
||||
if (it == d->animations.end()) {
|
||||
kDebug() << "Phase::advanceFrame found no entry in animations!" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user