Creating a private class to store data in AbstractAnimation.

The idea is to other parameters (e.g. m_distance, m_factor, etc) to it.


svn path=/trunk/KDE/kdelibs/; revision=1036716
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-10-17 17:02:28 +00:00
parent 191256f279
commit c07d566656
2 changed files with 16 additions and 9 deletions

View File

@ -22,24 +22,33 @@
namespace Plasma
{
AbstractAnimation::AbstractAnimation()
class AnimationPrivate
{
public:
/**
* Object the animation(s) should act upon.
*/
QGraphicsWidget* m_object;
};
AbstractAnimation::AbstractAnimation(): d(new AnimationPrivate)
{
}
AbstractAnimation::~AbstractAnimation()
{
delete d;
}
void AbstractAnimation::setWidget(QGraphicsWidget* receiver)
{
m_object = receiver;
d->m_object = receiver;
}
QGraphicsWidget* AbstractAnimation::getAnimatedObject()
{
return m_object;
return d->m_object;
}
} //namespace Plasma

View File

@ -35,6 +35,8 @@
namespace Plasma
{
class AnimationPrivate;
/**
* Abstract base class for AnimationGroup and Animation.
*/
@ -73,11 +75,7 @@ protected:
private:
/**
* Object the animation(s) should act upon.
*/
QGraphicsWidget* m_object;
AnimationPrivate *d;
};
} //namespace Plasma