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>
This commit is contained in:
Tomaz Canabrava 2014-12-30 21:25:23 -02:00 committed by Dirk Hohndel
parent 4f4857f19f
commit 3e239c7e3e
2 changed files with 13 additions and 0 deletions

View file

@ -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

View file

@ -179,6 +179,7 @@ private:
DiveLineItem *mouseFollowerHorizontal;
RulerItem2 *rulerItem;
TankItem *tankItem;
InstantMeanDepthLine *instantMeanDepth;
bool isGrayscale;
bool printMode;