From 2e2a87e6196428280647085527720564c8e3c563 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 22 Jan 2014 15:08:19 -0200 Subject: Add a MeanDepthItem that has 2 strings. Dirk's implementation of the MeanDepth item was correct, but in order to add the 2 strings to it ( one at the begin, one at the end ) I had to put more stuff inside the ProfileWidget that's already packed with graphics items. So I created a new class MeanDepthItem that contains these 2 strings and will get updated whenever the value changes. I also fixed a math inconsistency where I changed RIGHT to LEFT. (wich fixed a few text-placements, and broke others.) Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveprofileitem.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'qt-ui/profile/diveprofileitem.h') diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index 57b1e70e8..272ee0821 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -4,6 +4,8 @@ #include #include #include "graphicsview-common.h" +#include "divelineitem.h" + /* This is the Profile Item, it should be used for quite a lot of things on the profile view. The usage should be pretty simple: @@ -100,4 +102,16 @@ public: virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); virtual void preferencesChanged(); }; -#endif \ No newline at end of file + +class MeanDepthLine : public DiveLineItem { + Q_OBJECT +public: + MeanDepthLine(); + void setMeanDepth(int value); + void setLine(qreal x1, qreal y1, qreal x2, qreal y2); +private: + int meanDepth; + DiveTextItem *leftText; + DiveTextItem *rightText; +}; +#endif -- cgit v1.2.3-70-g09d2