ReAdded the isAnimating() function to Phase.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797010
This commit is contained in:
Rob Scheepmaker 2008-04-14 18:04:34 +00:00
parent d5dd4e16ac
commit 54a3279aa7
2 changed files with 16 additions and 0 deletions

View File

@ -480,6 +480,14 @@ QPixmap Phase::animationResult(AnimId id)
return state->pixmap;
}
bool Phase::isAnimating() const
{
return (!d->animatedItems.isEmpty() ||
!d->movingItems.isEmpty() ||
!d->animatedElements.isEmpty() ||
!d->customAnims.isEmpty());
}
void Phase::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event)

View File

@ -116,6 +116,14 @@ public:
Q_INVOKABLE void setAnimationPixmap(AnimId id, const QPixmap &pixmap);
Q_INVOKABLE QPixmap animationResult(AnimId id);
/**
* Can be used to query if there are other animations happening. This way
* heavy operations can be delayed until all animations are finished.
* @return true if there are animations going on.
* @since 4.1
*/
Q_INVOKABLE bool isAnimating() const;
Q_SIGNALS:
void animationComplete(QGraphicsItem *item, Plasma::Phase::Animation anim);
void movementComplete(QGraphicsItem *item);