add Easing Curve Type Property
svn path=/trunk/KDE/kdelibs/; revision=1038000
This commit is contained in:
parent
dd2b126960
commit
cbc0f99d2a
@ -20,13 +20,15 @@
|
||||
#include "abstractanimation.h"
|
||||
#include "private/animationprivate_p.h"
|
||||
|
||||
#include <QEasingCurve>
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
|
||||
AbstractAnimation::AbstractAnimation(): d(new AnimationPrivate)
|
||||
{
|
||||
|
||||
d->easingCurve = QEasingCurve::Linear;
|
||||
}
|
||||
|
||||
AbstractAnimation::~AbstractAnimation()
|
||||
@ -44,6 +46,16 @@ QGraphicsWidget* AbstractAnimation::getAnimatedObject()
|
||||
return d->animObject;
|
||||
}
|
||||
|
||||
void AbstractAnimation::setEasingCurveType(QEasingCurve::Type easingCurve)
|
||||
{
|
||||
d->easingCurve = easingCurve;
|
||||
}
|
||||
|
||||
QEasingCurve::Type AbstractAnimation::easingCurveType() const
|
||||
{
|
||||
return d->easingCurve;
|
||||
}
|
||||
|
||||
AnimationPrivate* AbstractAnimation::getAnimationPrivate()
|
||||
{
|
||||
return d;
|
||||
|
@ -26,12 +26,14 @@
|
||||
#define PLASMA_ABSTRACTANIMATION_H
|
||||
|
||||
#include <QAbstractAnimation>
|
||||
#include <QEasingCurve>
|
||||
#include <QGraphicsWidget>
|
||||
#include <QObject>
|
||||
|
||||
#include <plasma/plasma.h>
|
||||
#include <plasma/plasma_export.h>
|
||||
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
@ -44,6 +46,7 @@ class PLASMA_EXPORT AbstractAnimation : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QEasingCurve::Type easingCurveType READ easingCurveType WRITE setEasingCurveType)
|
||||
|
||||
public:
|
||||
|
||||
@ -62,6 +65,16 @@ public:
|
||||
*/
|
||||
virtual QAbstractAnimation* toQAbstractAnimation(QObject* parent) = 0;
|
||||
|
||||
/**
|
||||
* Set the animation easing curve type
|
||||
*/
|
||||
void setEasingCurveType(QEasingCurve::Type easingCurve);
|
||||
|
||||
/**
|
||||
* Get the animation easing curve type
|
||||
*/
|
||||
QEasingCurve::Type easingCurveType() const;
|
||||
|
||||
public slots:
|
||||
|
||||
/**
|
||||
|
@ -21,6 +21,8 @@
|
||||
#ifndef PLASMA_ANIMATIONPRIVATE_H
|
||||
#define PLASMA_ANIMATIONPRIVATE_H
|
||||
|
||||
#include <QEasingCurve>
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
@ -55,6 +57,11 @@ public:
|
||||
*/
|
||||
bool animVisible;
|
||||
|
||||
/**
|
||||
* Animation easing curve type
|
||||
*/
|
||||
QEasingCurve::Type easingCurve;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user