Adding a setter for grow factor property.

svn path=/trunk/KDE/kdelibs/; revision=1039066
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-10-22 16:25:48 +00:00
parent 8a930cbaca
commit 71528727ea
2 changed files with 17 additions and 1 deletions

View File

@ -30,6 +30,16 @@ GrowAnimation::GrowAnimation(qreal factor)
{
}
void GrowAnimation::setFactor(qreal factor)
{
m_animFactor = qBound(qreal(0.0), factor, qreal(1.0));
}
qreal GrowAnimation::factor() const
{
return m_animFactor;
}
QAbstractAnimation* GrowAnimation::render(QObject* parent){
//get current geometry values

View File

@ -41,12 +41,18 @@ namespace Plasma
class GrowAnimation : public Animation
{
Q_OBJECT
Q_PROPERTY(qreal factor READ factor WRITE setFactor)
public:
/* TODO: convert to qreal */
GrowAnimation(qreal factor = 0.5);
virtual ~GrowAnimation(){};
qreal factor() const;
void setFactor(qreal);
protected:
virtual QAbstractAnimation* render(QObject* parent = 0);