profile: set axis in constructor of TankItem

There is no point in a separate set-axis function if we never
change the axis anyway. Make the axis a const-reference to
show that it can never be changed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-12-23 12:33:05 +01:00 committed by Dirk Hohndel
parent 47d673bda3
commit 7da5719cab
3 changed files with 7 additions and 15 deletions

View file

@ -150,7 +150,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
mouseFollowerHorizontal(new DiveLineItem()),
rulerItem(new RulerItem2()),
#endif
tankItem(new TankItem()),
tankItem(new TankItem(*timeAxis)),
shouldCalculateMaxTime(true),
shouldCalculateMaxDepth(true),
fontPrintScale(1.0)
@ -318,8 +318,6 @@ void ProfileWidget2::setupItemOnScene()
diveComputerText->setAlignment(Qt::AlignRight | Qt::AlignTop);
diveComputerText->setBrush(getColor(TIME_TEXT, isGrayscale));
tankItem->setHorizontalAxis(timeAxis);
#ifndef SUBSURFACE_MOBILE
rulerItem->setAxis(timeAxis, profileYAxis);