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 e21af21bd..2f607590b 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -146,6 +146,15 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
gasPressureItem->setZValue(1);
scene()->addItem(gasPressureItem);
+ temperatureItem = new DiveTemperatureItem();
+ temperatureItem->setHorizontalAxis(timeAxis);
+ temperatureItem->setVerticalAxis(temperatureAxis);
+ temperatureItem->setModel(dataModel);
+ temperatureItem->setVerticalDataColumn(DivePlotDataModel::TEMPERATURE);
+ temperatureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
+ temperatureItem->setZValue(1);
+ scene()->addItem(temperatureItem);
+
background->setFlag(QGraphicsItem::ItemIgnoresTransformations);
//enum State{ EMPTY, PROFILE, EDIT, ADD, PLAN, INVALID };
@@ -377,19 +386,6 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
event = event->next;
}
- if(temperatureItem){
- scene()->removeItem(temperatureItem);
- delete temperatureItem;
- }
- temperatureItem = new DiveTemperatureItem();
- temperatureItem->setHorizontalAxis(timeAxis);
- temperatureItem->setVerticalAxis(temperatureAxis);
- temperatureItem->setModel(dataModel);
- temperatureItem->setVerticalDataColumn(DivePlotDataModel::TEMPERATURE);
- temperatureItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
- temperatureItem->setZValue(1);
- scene()->addItem(temperatureItem);
-
diveComputerText->setText(currentdc->model);
diveComputerText->animateMoveTo(1 , sceneRect().height());
emit startProfileState();