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:
parent
191256f279
commit
c07d566656
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user