aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-12-23 12:33:05 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-10 15:57:39 -0800
commit7da5719cabdbe00d71264aa1a5fb492573c5e57a (patch)
treef590608b2fb14fb31bdbc92caa4a7e61f2b3e23e /profile-widget/profilewidget2.cpp
parent47d673bda324bf4a884fa41a0b95d08692a6f712 (diff)
downloadsubsurface-7da5719cabdbe00d71264aa1a5fb492573c5e57a.tar.gz
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>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r--profile-widget/profilewidget2.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index ae215e67a..a9d78f5ee 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -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);