From 8773b4f9f0dd335e9326f9e45359332dd9f717de Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 15 Jan 2014 11:08:31 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/divecartesianaxis.cpp | 5 +++++ qt-ui/profile/divecartesianaxis.h | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'qt-ui') 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 -- cgit v1.2.3-70-g09d2