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

@ -11,14 +11,13 @@
class TankItem : public QGraphicsRectItem
{
public:
explicit TankItem();
void setHorizontalAxis(DiveCartesianAxis *horizontal);
explicit TankItem(const DiveCartesianAxis &axis);
void setData(struct plot_info *plotInfo, struct dive *d);
private:
void createBar(int startTime, int stopTime, struct gasmix gas);
void replot();
DiveCartesianAxis *hAxis;
const DiveCartesianAxis &hAxis;
int plotEndTime;
QBrush air, nitrox, oxygen, trimix;
QList<QGraphicsRectItem *> rects;