aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-15 10:54:33 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 10:12:30 +0700
commit67f2c0bcaa28f30acb92f84bd83ea4bb398b614c (patch)
tree05435fee28d84f275945963e27daa340a4f70f51 /qt-ui/profile
parent90fc7a23f2f61a78f81460aa0998b5681622f83f (diff)
downloadsubsurface-67f2c0bcaa28f30acb92f84bd83ea4bb398b614c.tar.gz
Added a 'Depth' Axis that knows how to add its strings on screen.
The CartesianAxis used a simple method to put things on screen which is wrong for almost any case besides the 'current value here' since we store things in milimeters on the axis, we need to convert those to meters before showing on the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp5
-rw-r--r--qt-ui/profile/divecartesianaxis.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 358b85ef4..8b7269c35 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -178,3 +178,8 @@ void DiveCartesianAxis::setColor(const QColor& color)
defaultPen.setCosmetic(true);
setPen(defaultPen);
}
+
+QString DepthAxis::textForValue(double value)
+{
+ return get_depth_string(value, false, false);
+}
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index 1c8170ef4..9b5da4747 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -43,4 +43,9 @@ protected:
QColor textColor;
};
+class DepthAxis : public DiveCartesianAxis {
+protected:
+ QString textForValue(double value);
+};
+
#endif \ No newline at end of file