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.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index ba71a9fba..12b04f4bc 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -102,6 +102,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
mouseFollowerHorizontal(new DiveLineItem()),
rulerItem(new RulerItem2()),
tankItem(new TankItem()),
+ instantMeanDepth(new InstantMeanDepthLine()),
isGrayscale(false),
printMode(false),
shouldCalculateMaxTime(true),
@@ -170,6 +171,7 @@ ProfileWidget2::~ProfileWidget2()
delete mouseFollowerHorizontal;
delete rulerItem;
delete tankItem;
+ delete instantMeanDepth;
}
#define SUBSURFACE_OBJ_DATA 1
@@ -208,6 +210,7 @@ void ProfileWidget2::addItemsToScene()
scene()->addItem(tankItem);
scene()->addItem(mouseFollowerHorizontal);
scene()->addItem(mouseFollowerVertical);
+ scene()->addItem(instantMeanDepth);
QPen pen(QColor(Qt::red).lighter());
pen.setWidth(0);
mouseFollowerHorizontal->setPen(pen);
@@ -273,6 +276,12 @@ void ProfileWidget2::setupItemOnScene()
meanDepth->setZValue(1);
meanDepth->setAxis(profileYAxis);
+ instantMeanDepth->setLine(0, 0, 96, 0);
+ instantMeanDepth->setX(3);
+ instantMeanDepth->setPen(QPen(QBrush(Qt::red), 0, Qt::SolidLine));
+ instantMeanDepth->setZValue(1);
+ instantMeanDepth->setAxis(profileYAxis);
+
diveComputerText->setAlignment(Qt::AlignRight | Qt::AlignTop);
diveComputerText->setBrush(getColor(TIME_TEXT, isGrayscale));
@@ -597,6 +606,9 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
meanDepth->setLine(0, 0, timeAxis->posAtValue(currentdc->duration.seconds), 0);
Animations::moveTo(meanDepth,3, profileYAxis->posAtValue(plotInfo.meandepth));
+ instantMeanDepth->setVisible(prefs.show_average_depth);
+ instantMeanDepth->setModel(dataModel);
+
dataModel->emitDataChanged();
// The event items are a bit special since we don't know how many events are going to
// exist on a dive, so I cant create cache items for that. that's why they are here