API cleansing:

* missing const on widgetToAnimate()
* widgetToAnimation -> targetWidget to be consistent with naming in QVariantAnimation which uses targetObject
* targetWidget is not virtual; all set up can be done in the stateChange method

svn path=/trunk/KDE/kdelibs/; revision=1069728
This commit is contained in:
Aaron J. Seigo 2010-01-04 09:16:41 +00:00
parent abc51630c5
commit 9f405a1425
2 changed files with 10 additions and 14 deletions

View File

@ -59,14 +59,15 @@ void Animation::setDuration(int duration)
d->duration = qMax(0, duration);
}
void Animation::setWidgetToAnimate(QGraphicsWidget* widget)
void Animation::setTargetWidget(QGraphicsWidget* widget)
{
d->animObject = widget;
if (parent() == 0)
if (parent() == 0) {
setParent(widget);
}
}
QGraphicsWidget* Animation::widgetToAnimate()
QGraphicsWidget* Animation::targetWidget() const
{
return d->animObject.data();
}

View File

@ -49,7 +49,7 @@ class PLASMA_EXPORT Animation : public QAbstractAnimation
Q_OBJECT
Q_PROPERTY(int duration READ duration WRITE setDuration)
Q_PROPERTY(QEasingCurve::Type easingCurveType READ easingCurveType WRITE setEasingCurveType)
Q_PROPERTY(QGraphicsWidget *widgetToAnimate READ widgetToAnimate WRITE setWidgetToAnimate)
Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget)
public:
/**
@ -81,22 +81,18 @@ public:
/**
* Destructor.
*/
virtual ~Animation() = 0;
~Animation() = 0;
/**
* Set the widget on which the animation is to be performed.
*
* If the animation class has any special initialization to be done
* in the target widget, you should reimplement this method in
* the derived class.
* @arg receiver The QGraphicsWidget to be animated.
* @arg widget The QGraphicsWidget to be animated.
*/
virtual void setWidgetToAnimate(QGraphicsWidget* widget);
void setTargetWidget(QGraphicsWidget* widget);
/**
* The widget that the animation will be performed upon
* @return The widget that the animation will be performed upon
*/
QGraphicsWidget *widgetToAnimate();
QGraphicsWidget *targetWidget() const;
/**
* Set the animation easing curve type
@ -109,7 +105,6 @@ public:
QEasingCurve::Type easingCurveType() const;
protected:
/**
* Change the animation duration. Default is 250ms.
* @arg duration The new duration of the animation.