summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-21 14:05:29 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-21 09:39:42 -0800
commit9d33640bea9332ca5afb3df71f7a12da9c29e080 (patch)
treeca18df037282a8100deab83c7bb66d8420b70064 /qt-ui/profile/diveprofileitem.h
parent21d34db3a94e004affdaceb091382b251071d89d (diff)
downloadsubsurface-9d33640bea9332ca5afb3df71f7a12da9c29e080.tar.gz
Add the gas presssure profile texts.
This just adds the texts for the gas profile. I've also added a method on the dataModel() to return the diveId of the last used dive in a way that the other methods can use it. This code is almost 1-to-1 with the old one, a bit of thinkering can be used to merge this loop with the upper one. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.h')
-rw-r--r--qt-ui/profile/diveprofileitem.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h
index b9be3edf4..bd1170f39 100644
--- a/qt-ui/profile/diveprofileitem.h
+++ b/qt-ui/profile/diveprofileitem.h
@@ -18,6 +18,7 @@
This is a generically item and should be used as a base for others, I think...
*/
+class DivePlotDataModel;
class DiveTextItem;
class DiveCartesianAxis;
class QAbstractTableModel;
@@ -32,7 +33,7 @@ public:
AbstractProfilePolygonItem();
void setVerticalAxis(DiveCartesianAxis *vertical);
void setHorizontalAxis(DiveCartesianAxis *horizontal);
- void setModel(QAbstractTableModel *model);
+ void setModel(DivePlotDataModel *model);
void setHorizontalDataColumn(int column);
void setVerticalDataColumn(int column);
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) = 0;
@@ -41,7 +42,7 @@ public slots:
protected:
DiveCartesianAxis *hAxis;
DiveCartesianAxis *vAxis;
- QAbstractTableModel *dataModel;
+ DivePlotDataModel *dataModel;
int hDataColumn;
int vDataColumn;
QList<DiveTextItem*> texts;
@@ -69,13 +70,13 @@ private:
class DiveGasPressureItem : public AbstractProfilePolygonItem{
Q_OBJECT
+
public:
virtual void modelDataChanged();
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
private:
+ void plot_pressure_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> align);
QVector<QPolygonF> polygons;
};
-QGraphicsItemGroup *plotText(text_render_options_t *tro,const QPointF& pos, const QString& text, QGraphicsItem *parent);
-
#endif \ No newline at end of file