Add signals targetReached and animationStep

svn path=/trunk/KDE/kdelibs/; revision=1030619
This commit is contained in:
Jacopo De Simoi 2009-10-02 19:06:14 +00:00
parent 7387d79cbd
commit b8d35a709c
2 changed files with 18 additions and 0 deletions

View File

@ -243,6 +243,9 @@ void ItemBackgroundPrivate::animationUpdate(qreal progress)
{
if (progress == 1) {
animId = 0;
if ((!fading) || (fadeIn)) {
emit q->targetReached(target);
}
}
if (fading) {
@ -260,6 +263,7 @@ void ItemBackgroundPrivate::animationUpdate(qreal progress)
}
q->update();
emit q->animationStep(progress);
}
void ItemBackgroundPrivate::targetDestroyed(QObject*)

View File

@ -68,6 +68,20 @@ Q_SIGNALS:
*/
void appearanceChanged();
/**
* Emitted at each animation frame. Useful for synchronizing item animations
*/
void animationStep(qreal progress);
/**
* Emitted when the target has been reached. Useful to consider this instead of
* the corresponding hoverEnterEvent;
*/
void targetReached(QGraphicsItem *);
protected:
/**
* @reimp from QGraphicsWidget