From fa3c18d83b3f8d8ec9ccb692bf385b07cde30412 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 14 Aug 2014 18:22:27 -0600 Subject: Add initial support for a visual tracker of gas used This shows a color-coded bar at the bottom of the graph that corresponds with the active gas. Todo: - text that explicitly states gas on the left edge of the bar - better vertical positioning of the bar - ability to turn this on and off Signed-off-by: Dirk Hohndel --- qt-ui/profile/tankitem.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 qt-ui/profile/tankitem.h (limited to 'qt-ui/profile/tankitem.h') diff --git a/qt-ui/profile/tankitem.h b/qt-ui/profile/tankitem.h new file mode 100644 index 000000000..2dc7dfaa2 --- /dev/null +++ b/qt-ui/profile/tankitem.h @@ -0,0 +1,34 @@ +#ifndef TANKITEM_H +#define TANKITEM_H + +#include +#include +#include "divelineitem.h" +#include "divecartesianaxis.h" +#include "dive.h" + +class TankItem : public QObject, public QGraphicsRectItem +{ + Q_OBJECT + Q_INTERFACES(QGraphicsItem) + +public: + explicit TankItem(QObject *parent = 0); + void setHorizontalAxis(DiveCartesianAxis *horizontal); + void setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d); + +signals: + +public slots: + virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex()); + +private: + DivePlotDataModel *dataModel; + DiveCartesianAxis *hAxis; + int hDataColumn; + struct dive *dive; + struct plot_info *pInfo; + QList rects; +}; + +#endif // TANKITEM_H -- cgit v1.2.3-70-g09d2