aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-12-30 21:25:23 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-30 16:13:41 -0800
commit3e239c7e3e8eac0911f8b3ccc67db032e8e56297 (patch)
treef0d50fd9875b2fe5db6969981040809231aabd16 /qt-ui/profile
parent4f4857f19f57393481e6eda7c8a1d174ed395e5f (diff)
downloadsubsurface-3e239c7e3e8eac0911f8b3ccc67db032e8e56297.tar.gz
Add the instantMeanDepth on Scene
But nothing is hoocked yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/profilewidget2.cpp12
-rw-r--r--qt-ui/profile/profilewidget2.h1
2 files changed, 13 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
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h
index 5a612d983..f35d07186 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -179,6 +179,7 @@ private:
DiveLineItem *mouseFollowerHorizontal;
RulerItem2 *rulerItem;
TankItem *tankItem;
+ InstantMeanDepthLine *instantMeanDepth;
bool isGrayscale;
bool printMode;