diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-15 11:08:31 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-16 10:12:30 +0700 |
commit | 8773b4f9f0dd335e9326f9e45359332dd9f717de (patch) | |
tree | 84fb54b9e19a16c61d00bdf7ce147d931f237ed3 | |
parent | 67f2c0bcaa28f30acb92f84bd83ea4bb398b614c (diff) | |
download | subsurface-8773b4f9f0dd335e9326f9e45359332dd9f717de.tar.gz |
Create a Time Axis that knows how to plot the minutes.
Created a Time Axis based on the CartesianAxis that knows
how to plot the minutes. This is needed because the CartesianAxis
donesn't knows about minutes at all, and would plot the
seconds instead.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 5 | ||||
-rw-r--r-- | qt-ui/profile/divecartesianaxis.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 8b7269c35..a12175461 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -183,3 +183,8 @@ QString DepthAxis::textForValue(double value) { return get_depth_string(value, false, false); } + +QString TimeAxis::textForValue(double value) +{ + return QString::number(value / 60); +}
\ No newline at end of file diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h index 9b5da4747..d6a60d3ce 100644 --- a/qt-ui/profile/divecartesianaxis.h +++ b/qt-ui/profile/divecartesianaxis.h @@ -48,4 +48,8 @@ protected: QString textForValue(double value); }; +class TimeAxis : public DiveCartesianAxis { +protected: + QString textForValue(double value); +}; #endif
\ No newline at end of file |