summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 3aa1acdae..e21af21bd 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -137,6 +137,15 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
scene()->addItem(tissueItem);
}
+ gasPressureItem = new DiveGasPressureItem();
+ gasPressureItem->setHorizontalAxis(timeAxis);
+ gasPressureItem->setVerticalAxis(cylinderPressureAxis);
+ gasPressureItem->setModel(dataModel);
+ gasPressureItem->setVerticalDataColumn(DivePlotDataModel::TEMPERATURE);
+ gasPressureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
+ gasPressureItem->setZValue(1);
+ scene()->addItem(gasPressureItem);
+
background->setFlag(QGraphicsItem::ItemIgnoresTransformations);
//enum State{ EMPTY, PROFILE, EDIT, ADD, PLAN, INVALID };
@@ -381,19 +390,6 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
temperatureItem->setZValue(1);
scene()->addItem(temperatureItem);
- if(gasPressureItem){
- scene()->removeItem(gasPressureItem);
- delete gasPressureItem;
- }
- gasPressureItem = new DiveGasPressureItem();
- gasPressureItem->setHorizontalAxis(timeAxis);
- gasPressureItem->setVerticalAxis(cylinderPressureAxis);
- gasPressureItem->setModel(dataModel);
- gasPressureItem->setVerticalDataColumn(DivePlotDataModel::TEMPERATURE);
- gasPressureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
- gasPressureItem->setZValue(1);
- scene()->addItem(gasPressureItem);
-
diveComputerText->setText(currentdc->model);
diveComputerText->animateMoveTo(1 , sceneRect().height());
emit startProfileState();