mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
9015160199
commit
fa3c18d83b
5 changed files with 144 additions and 0 deletions
34
qt-ui/profile/tankitem.h
Normal file
34
qt-ui/profile/tankitem.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef TANKITEM_H
|
||||
#define TANKITEM_H
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QModelIndex>
|
||||
#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<QGraphicsRectItem *> rects;
|
||||
};
|
||||
|
||||
#endif // TANKITEM_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue