summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divelineitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divelineitem.cpp')
-rw-r--r--qt-ui/profile/divelineitem.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/qt-ui/profile/divelineitem.cpp b/qt-ui/profile/divelineitem.cpp
index 9ceea1e70..834c1b8e3 100644
--- a/qt-ui/profile/divelineitem.cpp
+++ b/qt-ui/profile/divelineitem.cpp
@@ -1,4 +1,5 @@
#include "divelineitem.h"
+#include "animationfunctions.h"
#include <QPropertyAnimation>
DiveLineItem::DiveLineItem(QGraphicsItem *parent) : QGraphicsLineItem(parent)
@@ -8,17 +9,10 @@ DiveLineItem::DiveLineItem(QGraphicsItem *parent) : QGraphicsLineItem(parent)
void DiveLineItem::animatedHide()
{
- QPropertyAnimation *animation = new QPropertyAnimation(this, "opacity");
- connect(animation, SIGNAL(finished()), SLOT(deleteLater()));
- animation->setStartValue(1);
- animation->setEndValue(0);
- animation->start(QAbstractAnimation::DeleteWhenStopped);
+ Animations::hide(this);
}
void DiveLineItem::animateMoveTo(qreal x, qreal y)
{
- QPropertyAnimation *animation = new QPropertyAnimation(this, "pos");
- animation->setStartValue(property("pos").toPointF());
- animation->setEndValue(QPointF(x, y));
- animation->start(QAbstractAnimation::DeleteWhenStopped);
+ Animations::moveTo(this, x, y);
}