plasma: de-virtualize Plasma::Animation::setDuration() and make it public

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-17 21:10:35 +03:00
parent 54d5ec4782
commit 4152c2b044

View file

@ -26,8 +26,6 @@
#define PLASMA_ANIMATION_H #define PLASMA_ANIMATION_H
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QObject>
#include <QPropertyAnimation>
#include <QAbstractAnimation> #include <QAbstractAnimation>
#include <QEasingCurve> #include <QEasingCurve>
@ -53,12 +51,6 @@ class PLASMA_EXPORT Animation : public QAbstractAnimation
Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget) Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget)
public: public:
/**
* Get the animation duration. It can be set using the property duration.
* @return duration in ms.
*/
int duration() const;
/** /**
* Animation movement direction. * Animation movement direction.
*/ */
@ -69,7 +61,6 @@ public:
MoveDown = 0x4, MoveDown = 0x4,
MoveLeft = 0x8 MoveLeft = 0x8
}; };
Q_DECLARE_FLAGS(MovementDirection, MovementDirectionFlag) Q_DECLARE_FLAGS(MovementDirection, MovementDirectionFlag)
/** /**
@ -107,13 +98,19 @@ public:
*/ */
QEasingCurve easingCurve() const; QEasingCurve easingCurve() const;
protected:
/** /**
* Change the animation duration. Default is 250ms. * Get the animation duration. Default is 250ms.
* @return duration in ms.
*/
int duration() const;
/**
* Change the animation duration.
* @param duration The new duration of the animation. * @param duration The new duration of the animation.
*/ */
virtual void setDuration(int duration = 250); void setDuration(int duration);
protected:
/** /**
* QAbstractAnimation will call this method while the animation * QAbstractAnimation will call this method while the animation
* is running. Each specialized animation class should implement * is running. Each specialized animation class should implement
@ -125,7 +122,6 @@ protected:
virtual void updateCurrentTime(int currentTime); virtual void updateCurrentTime(int currentTime);
private: private:
/** /**
* Internal pimple (actually is used as a data structure, see * Internal pimple (actually is used as a data structure, see
* \ref AnimationPrivate). * \ref AnimationPrivate).