From c301367259ba46c8603d391b1ec7e489e06aa7de Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 15 Jan 2014 13:01:29 -0200 Subject: Added the Animations for the transitions of the States. This code creates the animations that will be triggered when an state changes. Things like hiding items and such should be handled this way. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'qt-ui/profile') 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 #include +#include 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 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. -- cgit v1.2.3-70-g09d2