1
/***************************************************************************
2
* KBlocks, a falling blocks game for KDE *
3
* Copyright (C) 2009 Mauricio Piacentini <mauricio@tabuleiro.com> *
4
* Zhongjie Cai <squall.leonhart.cai@gmail.com> *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
10
***************************************************************************/
11
#include "KBlocksAnimFade.h"
13
KBlocksAnimFade::KBlocksAnimFade(const QList<KBlocksSvgItem*> & items, int duration, QTimeLine::Direction direction)
17
mpTimeLine = new QTimeLine(duration);
18
mpTimeLine->setFrameRange( 0, 30 );
19
mpTimeLine->setDirection(direction);
21
connect(mpTimeLine, SIGNAL(valueChanged(qreal)), SLOT(valueChanged(qreal)));
22
connect(mpTimeLine, SIGNAL(finished()), SLOT(endAnimation()));
27
KBlocksAnimFade::~KBlocksAnimFade()
32
void KBlocksAnimFade::valueChanged(qreal value)
34
foreach(KBlocksSvgItem * pItem, mItemList)
36
pItem->setOpacity(value);
40
void KBlocksAnimFade::endAnimation()
42
emit animationFinished();