summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/profilewidget2.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 9fbcb9a24..f052c88c8 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -8,6 +8,7 @@
#include <QStateMachine>
#include <QSignalTransition>
+#include <QPropertyAnimation>
ProfileWidget2::ProfileWidget2(QWidget *parent) :
QGraphicsView(parent),
@@ -176,6 +177,30 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
planState->assignProperty(depthController, "y", depthControllerOnCanvas);
planState->assignProperty(timeController, "y", timeControllerOnCanvas);
+ // All animations for the State Transitions.
+ QPropertyAnimation *backgroundYAnim = new QPropertyAnimation(background, "y");
+ QPropertyAnimation *depthAxisAnim = new QPropertyAnimation(profileYAxis, "x");
+ QPropertyAnimation *gasAxisanim = new QPropertyAnimation(gasYAxis, "x");
+ QPropertyAnimation *timeAxisAnim = new QPropertyAnimation(timeAxis, "y");
+ QPropertyAnimation *depthControlAnim = new QPropertyAnimation(depthController, "y");
+ QPropertyAnimation *timeControlAnim = new QPropertyAnimation(timeController, "y");
+ QPropertyAnimation *profileAxisAnim = new QPropertyAnimation(profileYAxis, "line");
+
+// Animations
+ QList<QSignalTransition*> transitions;
+ transitions << tAddToEmpty << tAddToPlan << tAddToProfile << tEditToAdd << tEditToEmpty << tEditToPlan
+ << tEditToProfile << tEmptyToAdd << tEmptyToPlan << tEmptyToProfile << tProfileToAdd << tProfileToEdit
+ << tProfileToEmpty << tProfileToPlan << tPlanToAdd << tPlanToEmpty << tPlanToProfile;
+ Q_FOREACH(QSignalTransition *s, transitions){
+ s->addAnimation(backgroundYAnim);
+ s->addAnimation(depthAxisAnim);
+ s->addAnimation(gasAxisanim);
+ s->addAnimation(timeAxisAnim);
+ s->addAnimation(depthControlAnim);
+ s->addAnimation(timeControlAnim);
+ s->addAnimation(profileAxisAnim);
+ }
+
}
// Currently just one dive, but the plan is to enable All of the selected dives.