diff options
Diffstat (limited to 'qt-ui/profile/animationfunctions.cpp')
-rw-r--r-- | qt-ui/profile/animationfunctions.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp index bd08a22ee..c680e11a5 100644 --- a/qt-ui/profile/animationfunctions.cpp +++ b/qt-ui/profile/animationfunctions.cpp @@ -36,6 +36,16 @@ namespace Animations { } } + void scaleTo(QObject *obj, qreal scale) + { + QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale"); + animation->setDuration(prefs.animation); + animation->setStartValue(obj->property("scale").toReal()); + animation->setEndValue(QVariant::fromValue(scale)); + animation->setEasingCurve(QEasingCurve::InCubic); + animation->start(QAbstractAnimation::DeleteWhenStopped); + } + void moveTo(QObject *obj, const QPointF &pos) { moveTo(obj, pos.x(), pos.y()); |