diff options
Diffstat (limited to 'profile-widget/tankitem.cpp')
| -rw-r--r-- | profile-widget/tankitem.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index d87b1228b..849bab92c 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -7,7 +7,8 @@ static const qreal height = 3.0; -TankItem::TankItem() : +TankItem::TankItem(const DiveCartesianAxis &axis) : + hAxis(axis), plotEndTime(-1) { QColor red(PERSIANRED1); @@ -28,7 +29,6 @@ TankItem::TankItem() : trimixGradient.setColorAt(1.0, red); trimix = trimixGradient; air = blue; - hAxis = nullptr; } void TankItem::setData(struct plot_info *plotInfo, struct dive *d) @@ -48,8 +48,8 @@ void TankItem::setData(struct plot_info *plotInfo, struct dive *d) void TankItem::createBar(int startTime, int stopTime, struct gasmix gas) { - qreal x = hAxis->posAtValue(startTime); - qreal w = hAxis->posAtValue(stopTime) - hAxis->posAtValue(startTime); + qreal x = hAxis.posAtValue(startTime); + qreal w = hAxis.posAtValue(stopTime) - hAxis.posAtValue(startTime); // pick the right gradient, size, position and text QGraphicsRectItem *rect = new QGraphicsRectItem(x, 0, w, height, this); @@ -106,8 +106,3 @@ void TankItem::replot() } createBar(startTime, plotEndTime, gasmix); } - -void TankItem::setHorizontalAxis(DiveCartesianAxis *horizontal) -{ - hAxis = horizontal; -} |